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.
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.
Share Improve this question edited Dec 16, 2009 at 14:52 Andreas Bonini 44.9k31 gold badges125 silver badges158 bronze badges asked Dec 16, 2009 at 14:37 onineaoninea 1,4734 gold badges14 silver badges15 bronze badges 1- 1 possible duplicate of What is the best way to upload a folder to a website? – Liam Commented Mar 6, 2014 at 15:08
4 Answers
Reset to default 2No 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: multiple file upload in just single browse click without jquery
Multiple File Selection For Uploading in ASP.NET
Edit:
For sure uploading multiple files at the same time is available now using html5 https://stackoverflow./search?q=multiple+file+upload+html5
EDIT
Turns out this is supported in Chrome 11, and seems to also work on Firefox if you use a vendor prefix: https://stackoverflow./a/5849341/486547
This is definitely possible with a Java applet, however the % of folks with a JRE installed has gotten pretty low these days (< 70%)
Google Drive does this (choose upload, then "Folder..") It works for me (Mac OS X 10.7.5 in Chrome).
I'm not entirely sure how yet. I'm working on a project where this matters, so I've been looking for a while. I'll update as soon as I have more.
Sounds like you're already aware of this, but in the mean time, you can use valums or blueimp to do multiple file upload.
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.
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