Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends ,

i am using file upload control in my project but i failed to get full path of file so anybody help me to solve this problem.
eg. required path F:\somedirectory\sub\filename.extention
Thank You.
Posted
Updated 13-Feb-12 1:47am
v2
Comments
manognya kota 13-Feb-12 7:46am    
could you please post your code what you have tried?
Rajesh Anuhya 13-Feb-12 7:47am    
Edited.
--RA

 
Share this answer
 
Comments
bbirajdar 13-Feb-12 8:52am    
excellent info in the link....
My 5
Rajesh Anuhya 13-Feb-12 8:57am    
Thanks
--RA
try

C#
Server.MapPath(FileUpload1.FileName);


Hope it helps.
 
Share this answer
 
Comments
Nilesh Patil Kolhapur 13-Feb-12 7:53am    
it gives root path and i want hard drive path
Syed Salman Raza Zaidi 13-Feb-12 8:05am    
try this Path.GetFullPath(FileUpload1.FileName)
When you are working with the FileUpload control , you dont need the full path of the file where the file comes from.

Instead on the click of "Submit" or "Upload" button, you just need to check the FileUpload1.HasFile property and then save the file to the server on any path using

FileUpload1.SaveAs(pathOnServer");

The FullPath is not displayed as a security measure to avoid exposing the client's machine's folder structure or drives to the server.
 
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