Click here to Skip to main content
15,077,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Like we set the text property of text box (e.g textbox1.text=”some text”) I want to set filename property of a fileupload control in ASP.Net. Does anybody have such experience?
Posted
Comments
[no name] 2-May-14 17:19pm
   
The FileName property of the FileUpload control is read only. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.filename(v=vs.110).aspx
Richard C Bishop 2-May-14 17:31pm
   
Are you trying to change the name of the file you are uploading?

1 solution

No, sorry. You can't.

This is not possible due to Security Restrictions. Browsers don't allow this.
FileUpload is set with the path, when user make a selection.

Alternate solution:- use Lable control to display file path rather than 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