By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

FileUpload PostedFile after Postback question

P: n/a
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.

Jun 5 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.

"ro****@gmail.com" wrote:
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.

Jun 5 '07 #2

P: n/a
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.
On Jun 5, 5:07 am, Siva M <shiva...@online.excite.comwrote:
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.

"ron...@gmail.com" wrote:
My environment is ASP.NET 2.0, C# andAJAX.
Is there a way to retain thePostedfilein the FileUpload control
afterPostback? 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.- Hide quoted text -

- Show quoted text -

Jun 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.