hi,

use <controller maxFileSize="1M"/>

set this in struts-config for maxFileSize.

look at file-upload-sample in your struts-distribution
There cames an error, if the file is bigger.

greetings

matthias


-----Original Message-----
From: Patrick Scheuerer [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 29, 2003 5:34 PM
To: Struts Users List
Subject: File Upload Validator


Hi,

I have to validate a form which collects all the data connected with a 
document. Allong with discriptive information there's also a <html:file>

element to upload the file itself. So far use a DynaValidatorForm to do 
validation. Everything works fine for the text based form elements. I 
would also like to validate the file (FormFile) for size (it shouldn't 
be bigger than e.g. 1 MB)  and MIME type (pdf, doc, exe, zip, etc.). Is 
there any extension for the Validator framework that can accomplish
this? Of course I could write my own validator class, I'm just curious
if 
something like this has been done already and is a readily available.

Thanks, Patrick


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to