FileUpload PostedFile after Postback question

  • Thread starter Thread starter ronc85
  • Start date Start date
R

ronc85

My environment is ASP.NET 2.0, C# and AJAX.

Is there a way to retain the Postedfile in the FileUpload control
after Postback? I have this application I've inherited were the User
chooses a file then clicks the "save" button, the program proceeds to
edit the file on the server and if it detects an error displays an
error message. At this point the filename is lost from the FileUpload
input field.

Sal P.
 
It is 'by design', for security reasons. The idea is that users should know
and explicitly select a file for upload. Hence cannot be retained across
postbacks.
 
Actually the FileUpload retains its state just fine after
postback...it only gets null'ed when dropped into an AJAX panel, when
the panel is removed it retains its state again even after
postback...so I have doubts that it is a question of security.
 
Back
Top