Click here to Skip to main content
15,891,694 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
C#
Hi,
I want to upload entire folder using ASP.net C#.Mvc.
Please help me..


What I have tried:

I hace tried multiple files upload.
Posted
Updated 19-Dec-16 4:14am

You don't upload a folder. You upload the files in the folder, individually.

Depending on the browser and version you're using, you may be limited to only doing one file at a time.

You didn't describe any particular problem or error messages you're getting nor showed the code you're using to pick the files and upload them on the client and the server side, so it's pretty much impossible to tell you what may be wrong.
 
Share this answer
 
As mentioned in Solution, you need to upload have a file that needs to be uploaded. Archive that folder and then upload as a file. For this, you need to ask the users to archive the folders first — otherwise use an offline software to do that and upload the files to server.

First method will not work, browsers will not allow selection of folders. There is a <input type="file" directory /> but that is not guaranteed to work. To know more on this, you need to understand how that input works,
How to get folder directory from HTML input type "file" or any other way? - Stack Overflow[^]
HTML input type Attribute[^]
Using files from web applications | MDN[^]
Directory Chooser in HTML page - Stack Overflow[^]

If you use second method then you can use the following class to zip a folder, ZipFile Class (System.IO.Compression)[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900