FileUpload PostedFile after Postback question

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.
 
G

Guest

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.
 
G

GenCode

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top