Is it possible to upload a whole folder instead of multiple files using Javascript? If so, what is the approach. If there is no straighforward approach, is there any workaround to achieve the same? I have always been curious about this topic. Any insights will help.
views:
84answers:
3
+1
A:
No you can't, except if its zipped, or you can use flash, silverlight or applet for uploading more than one file in the same time.
Check these questions: http://stackoverflow.com/questions/1043266/multiple-file-upload-in-just-single-browse-click-without-jquery/1043289#1043289
Amr ElGarhy
2009-12-16 14:41:39
thanks for the links.
oninea
2009-12-16 14:49:13
SWFUpload is a good thing for this.
Pekka
2009-12-16 14:53:49
Took a look at SWFUpload. It's as close as it gets to what I had in mind. Thanks for the push Pekka.
oninea
2009-12-16 15:11:34
A:
Of course there is. It opens a large security hole, but you can always use WScript and Filesystem ActiveX objects to access OS file system and transfer as many files as you like
alemjerus
2009-12-16 14:42:04
If by "always" you mean "not in most browsers or operating systems"... :-)
ceejayoz
2009-12-16 14:55:57
This is a bad solution, because it relies on an extremely small subset of browser platforms : Works only on an Internet Explorer running on a Windows machine. At a time when everything including smartphone contains browsers, you should go for a more generic solutions. A combination which feature both A. classic file-per-file upload and B. some plug-in as suggested by the 2 other posts (Java, Flash, etc.) should be versatile enough, while being user friendly in most cases.Facebook photo-upload works that way (HTML+Java)(But keep in mind that even things as popular as iPhones lack Flash).
DrYak
2009-12-16 15:10:07
So DrYak, if you wanna reach a wider browser audience, is html/javascript still the way to go? Asking this because I wanna port my website to run in Japanese phone browsers.
oninea
2009-12-16 15:14:53
A:
There is no way to do this in most browsers in javascript. Obviously though some (naive) browsers may have this functionality, as the javascript API is defined by the browser itself.
It may be possible using other technologies (such as silverlight, flash, etc) as mentioned in the other answers.
Andreas Bonini
2009-12-16 14:43:47