Click here to Skip to main content
15,938,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
how to get full path of input type file (image upload)..

because when i upload image , and check in .cs code , i get only name of image and not full path


pls advice

regards
maulik shah
Posted

Use Server.MapPath to fetch the full path.

Refer below to know different ways of using it.

http://www.aspnetcodes.com/2013/06/servermappath-in-c.html[^]
 
Share this answer
 
v2
Comments
maulikshah1990 22-Jan-14 6:49am    
can u give example code for the same using below

<input type="file" name="getypepath" id="idpath" />
As far as I know, you can not get the full path of a file on client side. You can get full path of a file which was on server but not like that "DriveName:\FolderName\FileName". Path of a file on server is like "www.domain_name.com/folder_name/file_name".
 
Share this answer
 
You cannot get the full path from the server side. When you think about it, this makes perfect sense as it would represent a major security vulnerability if the upload functionality were to reveal details about what the client side folder structures are. If you want to achieve this type of effect, then you need to write your own control that runs on the client side - if your app is running on Windows only, you could launch this as a ClickOnce app for instance. It's a very rare situation, however, where you need access to this level of detail,
 
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