[html5] Feature proposal - directory upload

--==[FReeZ]==-- programatorfreez at seznam.cz
Wed Jun 25 10:40:28 PDT 2008


I'm trying to solve a simple problem, since image galleries are very
popular. The user has one and wants to fill it with pictures. There
are thousands of pictures to upload in a directory on his hard-drive,
and that directory contains also subdirectories. Dimensions and names
of the pictures are not good. Every single picture must be uploaded
and processed on the server before it's added to the gallery.

(X)HTML doesn't offer any feature to solve it. I suggest to implement
input type='directory' to upload the whole directory, and a special
attribute recursive="true|false" which is false by default. The rest
would be similar to input type='file' to avoid a possible confusion,
and to keep the compatibility with current server side programming
languages.

<input type='directory' recursive='true' name='dirUpload1'> should be
a read-only editbox with a button labeled "Choose".

After clicking Choose, a DirectorySelection dialog should open and let
you choose 1 single directory.

After confirmation (Ok button of the dialog) an absolute path of
directory should be set to editbox.

There should not be a way to fill the value of editbox automatically
because the malicious scripts must not upload a directory without us.

The main routine must upload only non-hidden files from a selected
directory and prefix their names with relative paths.

Server side languages could obtain the well-known list of files from a
browser, as usual when user uploads more files per once. The only
difference from server side language's point of view is a relative
path to directory added before filename, like
photos/album-2008/january/IMG1823.JPEG instead of filename only
IMG1823.JPEG, because server side language should know what is from
january, album-2008 and what is from (for example) february,
album-2007 to categorize it properly.

I believe that input type='directory' is extremely useful feature, and
a good thing to implement, because it's simple to use, compatible with
current technology and easy to add, since we have input type='file' to
upload 1 file. Users want to upload a directory full of text
documents, or pictures, movies, music, source codes, etc. to save a
time spent in their (often commercial) FTP client. They enjoy much
more uploading from Internet coffee with web browser from any
location, than with FTP client that is installed only at their home.



More information about the Help mailing list