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
    1. Advertising

  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.

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


    "Larry Rebich" <> wrote in message
    news:...
    >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
    >
    >
     
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Oct 11, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3JpZGhhcg==?=

    InputFile.PostedFile.FileName not giving full file path

    =?Utf-8?B?U3JpZGhhcg==?=, May 24, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    5,885
    =?Utf-8?B?U3JpZGhhcg==?=
    May 24, 2006
  2. Karl
    Replies:
    0
    Views:
    349
  3. Replies:
    2
    Views:
    2,948
    GenCode
    Jun 19, 2007
  4. AAaron123
    Replies:
    6
    Views:
    1,323
    AAaron123
    Oct 13, 2009
  5. Jonathan Hyatt
    Replies:
    1
    Views:
    2,134
    Jonathan Hyatt
    Jun 8, 2004
Loading...

Share This Page