If you want to upload an entire folder, then you need to add the
multiple
and
directory
attributes to the file input:
<input type="file" name="file" accept="image/*" multiple directory webkitdirectory mozdirectory />
NB: You currently need to include the vendor-prefixed versions of the "directory" attribute as well.
HTMLInputElement.webkitdirectory - Web APIs | MDN[
^]
This is an unofficial extension to the HTML standard. It works in Edge, Firefox, Chrome, and Opera. It doesn't work in any version of IE or Safari, or in mobile browsers.
Can I use... Directory selection from file input[
^]
In browsers that don't support it, the
multiple
attribute will ensure that users can still select multiple files to upload.
In either case, the
Request.Files
collection will contain an
HttpPostedFile
for each posted file.