Click here to Skip to main content
15,908,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use

<input type="file" id="getValue" name="DayImage1" />

and get file name as

esed=1;

string fname = Request.Files["DayImage" + esed].FileName;

But the above gives only file name and not path..
Will it take the image from selected path in input type file

and save in my location directly...

pls advice
Posted
Updated 22-Jan-14 18:13pm
v2

1 solution

You can't get the File Path from a input file control. That is due to security reason.
Browsers don't allow you to read the path of file.
 
Share this answer
 
Comments
maulikshah1990 23-Jan-14 0:32am    
any solution to get filepath ............
VICK 23-Jan-14 0:54am    
I think not possible in Web Application...Because Browser Security does not allow to get access of the User Directory...
No, you can't. This is a Security Feature. If you are able to do it using any other method, it will be a hack.
So, don't do it. :)
maulikshah1990 23-Jan-14 1:05am    
pls provide any alternate solution...or how can i use asp.net <asp:FileUpload > and append it from jquery whenever required
That is not possible in any way. Why you need that?

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