Click here to Skip to main content
14,334,458 members
Rate this:
Please Sign up or sign in to vote.
See more:
I use

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

and get file name as


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
Updated 22-Jan-14 18:13pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
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: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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100