FileUpload Control PostedFile.FileName is ReadOnly

Discussion in 'ASP .Net Web Controls' started by Larry Rebich, Oct 11, 2007.

  1. Larry Rebich

    Larry Rebich Guest

    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
    Larry Rebich, Oct 11, 2007
    1. Advertisements

  2. 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.
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Oct 11, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.