Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I like to upload a file using file uploader in mvc3 application. I am getting the path of the file as "C:\fakepath\filename.jpg". How to get the full path.Kindly help me for the same with some example.
Posted
Comments
Prasad Khandekar 5-Jun-13 9:31am    
Hello,

For security reasons modern browsers will not send the full file path along with the name. Though IE-8 will still give you a full fake path. From the server side generally it should not really mater. Many of the times the client side path may not even exists on the server side and even if it exists there can be a permission issue. Generally you will use your own directory structure on the server side to store such files.

Regards,

Did you try..."~/file_address/filename.jpg" or "../file_address/filename.jpg"? And also, rememeber you need to add the file to the project so it can call it from it's own content and not from your computer. You can do that by right-clicking on Images in your solution explorer and add existent file.
 
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