These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:06 pm Advanced search

Uploading multiple files with one field [solved]

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Uploading multiple files with one field [solved]

Postby iGEL » Fri Aug 22, 2008 10:34 am

What is the problem you are trying to solve?

The file input field allowes just to select one file a time. But more and more applications will require to upload more than one file. It would be very helpful for the user to be able to select multiple files in one field.

What is the feature you are suggesting to help solve it?

An additional attribute for the field. For example multiple="multiple". The files will be uploaded the same way like in todays browsers with several file input fields, but all files will be uploaded having the same field name. But if you use something like "file[]" as the name, popular scripting-languages like PHP will accept them without any modification to the language itself.

Browser without support for this feature would just ignore this attribute, allowing to upload just one file like today. That is acceptable.

I also could think about some additional, but optional attributes like "max-files" (defining the maximal possible files accepted by the application) or "rows". If rows has a bigger value than 1, the field would be displayed like a textarea with one file per row. If more files are displayed, a scrollbar would be presented. If rows is set to its default value 1, it would look like todays file inputs and the files would be seperated by a coma or semicolon.

Why do you think browsers would implement this feature?

Because it is easy to do without much side effects. Also it greatly helps the users.

Why do you think authors would use this feature?

Because it is often implemented by many webdevelopers using flash or javascript.

What evidence is there that this feature is desparately needed?

The wide usage of plugins in flash or java implementing the feature over and over again.
Last edited by iGEL on Tue Aug 26, 2008 3:32 pm, edited 1 time in total.
iGEL
<h6>
 
Posts: 4
Joined: Fri Aug 22, 2008 10:11 am

Postby Le Sage » Mon Aug 25, 2008 7:27 am

Seems like your idea is interesting, though it won't work on current browsers.
Actually, it is easy solvable with a form (with checkboxes for example), & a dynamic zip function on server-side to zip files dynamically (easily done with PHP or JSP for example).
I guess it would also be interesting to allow to do without any server-side code for people that don't have access to it, though many people with a blog do have access to PHP functions nowadays.
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby iGEL » Mon Aug 25, 2008 8:53 am

Of course it wouldn't work in current browsers, that's the problem I'm trying to solve. ;) But current browsers would just ignore the proprosed attribute, allowing the user to upload at least one file.

I think forcing the user to use an external tool like zip to pack all files into one zip achive and upload this archive is way to complicated for most users...
iGEL
<h6>
 
Posts: 4
Joined: Fri Aug 22, 2008 10:11 am

Postby Le Sage » Tue Aug 26, 2008 8:08 am

You didn't understand what I meant : let's say you know PHP : you can write a HTML form (with checkboxes for examples) to give the user the possibility to choose dynamically which files he wants among a specified list, & then the server gets the request (GET), & can dynamically zip the files you want (PHP can do that), & send back the result to the user.
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco

Postby iGEL » Tue Aug 26, 2008 8:18 am

I think, you missed a point: I'm trying to upload several files, not download!
iGEL
<h6>
 
Posts: 4
Joined: Fri Aug 22, 2008 10:11 am

Postby zcorpan » Tue Aug 26, 2008 3:09 pm

http://www.whatwg.org/specs/web-forms/c ... rk/#upload

This works in Opera today.

Code: Select all
<input type=file max=1000>
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby iGEL » Tue Aug 26, 2008 3:31 pm

Perfect, thank you! Of cause I've searched the specs before posting, but I've missed the point, that there is an extra spec just for web-forms. Sorry for that.
iGEL
<h6>
 
Posts: 4
Joined: Fri Aug 22, 2008 10:11 am

Postby Le Sage » Sun Aug 31, 2008 6:17 pm

iGEL wrote:I think, you missed a point: I'm trying to upload several files, not download!

Ooops, totally missed that, sorry. :oops:
User avatar
Le Sage
<h3>
 
Posts: 54
Joined: Wed Dec 05, 2007 9:08 pm
Location: Casablanca, Morocco


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest