Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader and validation before uploading Options
Code Monkey
Posted: Monday, February 11, 2008 10:55:16 AM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2008
Posts: 37
Hello,

I require certain text fields to be filled in before uploading any files but I am having no luck.

The text fields all have requiredfieldvalidators set up for them. The CausesValidation property of the upload button in the AJAXUploader template is set to true but that does not seem to help me.

Thank you in advance.
eo_support
Posted: Monday, February 11, 2008 11:14:48 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Hi,

The AJAXUploader performs validation not before starting upload, but before submitting the uploaded result. Consider the following sequence:

1. User clicks browser button to browser a file;
2. User clicks upload button to start upload;
3. While uploading, user can perform other tasks, such as filling in other form element, for example, some text fields;
4. Uploader finishes transferring file. The file is stored in a temporary file in the server side TempLocation folder. This is similar to user have typed in a letter in a textbox, but hasn’t submitted it yet;
5. User submit the page, this can be triggered by the uploader itself through AutoPostBack property, or by any other controls in the page, for example, a regular button;

Validations are performed on step 5, not step 2. The reason is because no server side code of yours will be called on step 2 and the user has really only ready to submit what he wants to give to you on step 5, all the time before step 5 he is only preparing his input. Another reason is, one of the advantage of our uploader is you can enter other things when the file is being uploaded. So the user can start uploading and then go to fill out those text fields that you require user to fill.

If you absolutely have to perform validations before starting upload, a solution is provided here:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=1008

Thanks
Code Monkey
Posted: Monday, February 11, 2008 11:22:39 AM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2008
Posts: 37
eo_support wrote:

If you absolutely have to perform validations before starting upload, a solution is provided here:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=1008

Thanks


Ok, I will try that method.

Some things must be done before allowing upload, for example a CAPTCHA entry.

Thanks.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.