Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is there any option in Visual Studio 2010 to browse folder in asp .net and find it path
from d disk

What I have tried:

I have Search There is a FileBrowserUpload but it only works for windows application
Posted
Updated 24-May-16 3:12am
Comments
Simon_Whale 24-May-16 6:18am    
Are you trying to see a physical path to which you will upload the file to within the site?
Khan Sameer 24-May-16 6:45am    
get the physical path from the client hard disk
Karthik_Mahalingam 24-May-16 6:27am    
Khan Sameer 24-May-16 6:32am    
no like file uploader i want whole folder to upload
Khan Sameer 24-May-16 6:28am    
Actually I want to upload a folder that contain .jpg files and i file name exist on that folder than it will be inserted in the database. so i want to browse and find the path get it !!!!

1 solution

Code running on the server cannot access files on the client.

Javascript code running in the browser can only access files that the user explicitly selects, using a file input control.

Chrome supports adding a directory attribute to a file input, which will allow the user to select a directory. All files within that directory will then be uploaded to the server.

Other browsers do not support the directory attribute. Instead, you will need to rely on the multiple attribute to allow the user to select multiple files to upload.

ASP.NET
<asp:FileUpload id="Files" runat="server"
    AllowMultiple="True"
    directory
/>

C#
if (Files.HasFiles)
{
    foreach (HttpPostedFile file in Files.PostedFiles)
    {
        // Do something with the uploaded file here...
    }
}
 
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