Click here to Skip to main content
16,015,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I need to get full path of the file using file upload control. if it is not possible through file upload then please give me an alternative way, except paid API's.

Regards
Posted

Use file upload control.
And in code behind....
C#
string path = Server.MapPath(FileUpload1.FileName);

("FileUpload1" is the id of file upload control in aspx)
 
Share this answer
 
Comments
S.Aijaz 31-Jan-12 8:48am    
i did that but itz not giving me the path of file intead itz giving path of root of application
You asked to get the full path. That's why I answered this.
Tell me what exactly you need. I will help you.
Server.MapPath() results as.....
For example- file name - Hydrangeas.jpg
Path - D:\Demo_Projects\IIS_Uninstalled_Projects\TestGridView\TestGridView\Hydrangeas.jpg

So, it gives the path of the file also, not only path of application...
shibin.sree 22-Jun-13 5:18am    
k
So, is it solved?

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