W3C home > Mailing lists > Public > www-html@w3.org > July 2000

Re: Form-based Multiple File Upload in HTML

From: Clover Andrew <aclover@1VALUE.com>
Date: Fri, 21 Jul 2000 11:54:03 +0200
Message-ID: <5F78AA062F6AD311A59000508B4AAF6D092B74@pcs02>
To: "'www-html@w3.org'" <www-html@w3.org>
Cc: "'cybbie@excite.com'" <cybbie@excite.com>
Cybbie <cybbie@excite.com> wondered:

> Can the latest HTML handle multiple file attachments using one
> input command (e.g. by choosing browse on a HTML page, is there
> a way for a user to to hold SHIFT and CTRL to select multiple
> files and/or directory that would contain multiple files)?

Yes, that's exactly how it's supposed to work. Opera is the
only browser I know of that supports it. True multiple-file
upload needs support at the server end too; be sure your
scripting environment supports it, or be prepared to writing
some MIME-parsing code.

> Currently, I have developed multiple file attachments (max
> of 5 files) by creating five individual inputs using HTML

If you can be sure there'll never be more than 5 files this is
indeed one cross-browser solution. Other possibilities are:

a. Detect when a file has been input and add new file upload
fields using JavaScript and DOM methods. Drawback is that
the DOM Core is almost as badly-supported as multiple
file upload, so you don't gain much.

b. Again, detect when a file is input and use JavaScript to
alter the 'display' style of divs containing lots of predefined
file input fields so that new ones appear when the old ones
are filled. This still limits the number of files you can
upload, but means the user isn't immediately confronted
with two dozen empty file upload boxes.

c. Make it a multi-stage form, so that you can upload one
file and then ask to upload another repeatedly until
finished. You then have to start remembering state so it
can get quite tricky at the server end.

> I haven't seen any of the multiple file attachments using
> one input command line anywhere on the Web.

Indeed. Browser support is weak, and many form-reading
scripts don't work properly when multiple files are uploaded.
It doesn't look as though support is going to get much better
in the near future, either.

> Your assistance would greatly be appreciated. Any good 
> Web-page examples of this function on the Internet
> would be really nice also! 

I've got one, but it's behind a login screen so if you
really want to see it send me a mail. It's not wonderfully
exciting. It's just a standard file upload field; unless
you've got Opera 4 handy, you won't be able to use it
for multiple files.

-- 
Andrew Clover
Technical Support
1VALUE.com AG
Received on Friday, 21 July 2000 05:58:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:43 GMT