Home All Groups Group Topic Archive Search About

FileUpload Control PostedFile.FileName is ReadOnly

Author
11 Oct 2007 8:13 PM
Larry Rebich
I would like to use the FileUpload Control on an Asp.Net form. And I'd like
to save and restore the FileName between sessions. It seems the property is
read only.

Is there a way to browse for a local file from an Asp.Net page and retain
the file name from session to session?

I've not been able to find anything using Google!

Thanks and Cheers,
Larry Rebich

Author
11 Oct 2007 9:34 PM
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
The FileUpload control does not allow this for security reasons.  If it did
allow such things, hackers could set the default filename to any standard
file on your system to queue it for upload to their servers.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net


Show quote
"Larry Rebich" <lreb***@earthlink.net> wrote in message
news:uhuw1MEDIHA.748@TK2MSFTNGP04.phx.gbl...
>I would like to use the FileUpload Control on an Asp.Net form. And I'd like
>to save and restore the FileName between sessions. It seems the property is
>read only.
>
> Is there a way to browse for a local file from an Asp.Net page and retain
> the file name from session to session?
>
> I've not been able to find anything using Google!
>
> Thanks and Cheers,
> Larry Rebich
>
>

AddThis Social Bookmark Button