Click here to Skip to main content
15,904,823 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Dear friends,

I need to get filepath from fileupload control. I can't get the value from fileupload. its shows the "C:\fakepath\<filename>" how to get the exact path.


I searched solution but for security purpose browser settings done like that.

What I have tried:

var scanedInv =  document.getElementById('<%= FileUploadScaned.ClientID %>').value;
Posted
Updated 27-Mar-17 2:05am

1 solution

You already have your answer, "I searched solution but for security purpose browser settings done like that."

The browser operates as a sandbox and you have to operate within the boundaries that it enforces. And one of those is not being able to find the path that a user uploads a file from.
 
Share this answer
 
Comments
Vivek.anand34 28-Mar-17 1:21am    
How to overcome this.. now i need take path in my project.
Vivek.anand34 28-Mar-17 1:22am    
then, how fb, twitter,... can get path for image upload.
AnvilRanger 28-Mar-17 8:05am    
They don't. You cannot access this information. I highly doubt that you have a valid reason to know the path where a user uploads a file from on your web site. You should be concerned with the type of file, the size of the file, etc.

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