File Upload Control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MBoogie
    New Member
    • May 2008
    • 4

    File Upload Control

    Is there any way to keep the filename property of a file upload control across page loads? If some other control in the form fails validation, the user has to select the file to upload again. ViewState is enabled. Thanks!

    Regards,

    MB
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    From what I have seen, I don't think so.
    If you could, someone could use CSS to hide the file input and auto-populate a value. You would then submit a file without ever even knowing it.

    that being said, there might be a javascript way around it, but that seemed to fail always too.

    Comment

    • MBoogie
      New Member
      • May 2008
      • 4

      #3
      I tried a few more things inspired by your post, but I think the users may just have to select the file to be uploaded again.

      1. These files could be named anything so I can't hard-code it.
      2. This property of the control is read-only so I can't use a hidden text field to hold on to the filename through the trip and set it again on the postback.

      So I will put this annoyance to rest. Thanks again.

      Comment

      • kunal pawar
        Contributor
        • Oct 2007
        • 297

        #4
        Using javascript we can assign values to fileupload controlm but at server side code get fails. so we have to browse file as Plater mention

        Comment

        Working...