Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping file upload control data on postback
Message
 
To
15/11/2011 14:51:50
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01528951
Message ID:
01529161
Views:
38
Personally I do file uploads asynchronously as AJAX or as an IFrame that's separate from main page content. Alternately, if I need to make sure the data needs to be valid before uploading a file I use a two step submit process to send the upload up - first submit the form data, then when that's been validated on the server redisplay the form with just the file upload (on the same page or a follow on page) and then let them do the upload separately.

This allows me to separate out the file upload from the main content and not get in the way of validation and other tasks. If the files to upload are really small I think it's OK to put them on the same page as form data, but otherwise separating the upload process out is a better idea IMHO.

+++ Rick ---

>It is known to browsers than when doing a postback, we are loosing the file upload control data (the full path of the file the user wanted to upload). This is a situation which may happen when a validation triggers on the server forcing a postback to the client. I do that when the upload control(s) are combined with textbox fields as well as other fields. If the validation fails, everything is shown as is to the user except the full path of the file on the file upload control(s). So, when this is the case, the user has to select the file(s) he/she wanted to upload.
>
>Based on that, many would prefer to separate the file upload support from other fields. So, this will diminish the possibilities of having a fail at the validation level.
>
>While searching for something else, I discovered that page today:
>
>http://www.ironspeed.com/articles/Maintain%20File%20Upload%20Control/Article.aspx
>
>The guy has found a trick to somewhat keep the file name which were uploaded. But, this is not technically a full way of keeping the data as there is no way of bouncing back the data into a file upload control for security reasons. Has anyone, except for highly sophisticated controls such as the Facebook multiple upload control, succeeded to bypass that security by the use of a regular file upload control?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform