struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <maili...@matthias-wessendorf.de>
Subject RE: File Upload Validator
Date Mon, 29 Dec 2003 16:44:34 GMT
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:tabalooga@hispeed.ch] 
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message