Link to home
Start Free TrialLog in
Avatar of Mr_Shaw
Mr_Shaw

asked on

FileUpload

I have some code which returns the file name which has been selected using the standard file uploader control. Here is the code;

Response.Write(FileUpload1.FileName + "<br>");

I need to be able to return the file location of the file which has been selected using the standard file uploader control. I am not sure how to do this.
ASKER CERTIFIED SOLUTION
Avatar of jinn_hnnl
jinn_hnnl
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For firefox any another browser, the only way you can do it is using javascript to set the selected file location somewhere (in hiddenfield) and then refer to it when the server is posted back

<asp:FileUpload ID="FileUpload1" runat="server" />

In Page_Load
FileUpload1.Attributes.Add("onchange", "SetFileLocation()");

SetFileLocation is the javascript file where you take the location and set it in the hidden field

Hope this give you some idea

JINN