Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping file upload control data on postback
Message
 
To
17/11/2011 15:33:37
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:
01529457
Views:
42
>>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.
>
>Thanks
>
>As they are usually small, I have them in the same form as the data. However, we do have validations also, from time to time, on the uploaded files. So, this may require a resubmit, even if the upload control(s) would be as part of the form or standalone.

Well files can only be uploaded once. They don't 'post back'. So once you've uploaded it one way you have to reselect (unless you use some AJAX control).

It's easy enough to validate file uploads seperately though from the rest of the input and then store some information about the file in the database. That way when the form proper is submitted you can do your validations as needed.

+++ Rick ---
+++ 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