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:
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

maulik shah

Use Server.MapPath to fetch the full path.

Refer below to know different ways of using it.[^]
Share this answer
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 "".
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