views:

36

answers:

2

If this can only be done in some browsers, I'd still like to know how...

Basically, I want to have a drag-and-drop feature where users can drag files to a drop zone and then hit "upload" and have the files uploaded to the server.

I was pondering the possibility of having the option to drag an entire folder to the drop zone and uploading all of the folder contents (preferably skipping any hidden or system folders). I can imagine how this would be done via javascript by simply traversing the folder for files (and sub-folders) and adding those locations to the upload list, but I'm pretty sure that would violate some basic policies (for good reason). But I'm not totally sure, since I know that Firefox 3.6 offers something along these lines.

I am thinking it might be possible if most browser policies make an exception for user-initiated events, but I might be dreaming.

Anybody know for sure?

A: 

http://www.uploadify.com/

This will let you do multiple file upload, but not directory upload. If you use a trusted applet, you can get the functionality you desire. It will require more than pure javascript, though.

Stefan Kendall
A: 

Browsers (before the file API) did not allow dropping things inside them from outside.

They would get intercepted by the browser and considered as drops to the browser engine..

Perhaps it can/could be done with flash or other embedded technologies.. but not directly through browser and javascript..

Gaby