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

I used file upload control for upload the image. i used file system for saving image. Image is saving in my project folder, that image path is stored in database.
All are working fine. but, i face problem here i.e,

In edit mode how to get the file path in fileupload control

If any one Know About this, Help me.

Regards,
Nanda Kishore.CH
Posted
Comments
ZurdoDev 9-Jul-12 8:20am    
What do you mean in edit mode?
nandkishorre 9-Jul-12 8:35am    
I need that image path in fileupload control in edit mode.. if i want to change image i upload new image in file upload control and after update that
bbirajdar 9-Jul-12 9:22am    
Not clear.. what has the edit more to do with file upload control?
Vipul J Patel 9-Jul-12 9:23am    
Hi,

Can you please explain in detail... ? and why you want to display image path in file upload control..?

Regards,
Rohan25M
nandkishorre 9-Jul-12 9:49am    
I am saving emplyoee datails including his photo in my application. It is saving successfully in database. i am saving photo path in my database and photo is saved in my application. I want to update the employee details in my application... i click on edit button all data is shown in edit mode in all controls but file path is not shown in fileupload control.. here i need to show file path in fileupload control for updating...

1 solution

Try this to show path in fileupload control:
C#
myFileUpload.Attributes.Add("value", pathYouWantToShow);


Though, I have a query:
Once a user selects a file from local desktop and upload on your website, file is saved in some folder on your server and this path of the server is saved in DB. Nowhere at all path of local desktop of the user is taken into account (if so then it's ok or else...).
What's the point of showing the path in fileupload control? It will not be the original local path but server path. Further, Do you want to expose your server path?


Last thing, file upload controls does not retain path even during uploads. Once page is posted back, they too loose it and this has been done by design to keeping security concerns in check. You too should follow the same and avoid showing any path.
 
Share this answer
 
Comments
nandkishorre 9-Jul-12 9:43am    
Hi, Its not work....
Paritosh kadam 10-May-14 5:29am    
this is not work...plz suggest anything other...the path is not displayed on FileUpload control.

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