Michael Sparer wrote:
> 
> Might be a bit off-topic, but I just wanted to add that if you're
> validating if the file has the correct content-type you shouldn't rely on
> the getContentType method, as it determines the type just using the
> extension. I did rely on that and to prevent users from uploading annoying
> animated gifs, allowed only jpg and png. Only a few days in production
> someone uploaded an animated gif by just changing the extension .gif to
> .jpg. To check the real type you should use an external tool such as e.g.
> JMimeMagic.
> Just have a look at the proposed approaches on
> http://www.rgagnon.com/javadetails/java-0487.html
> 
> regards,
> Michael
> 

Thanks for the info.

The example I gave was simple and for demo purpose only :) - I'm going to do
a lot of different things  (like checking color depth, bytesize, dimensions
etc).
-- 
View this message in context: 
http://www.nabble.com/Best-way-of-validating-FileUploadField-tp17662018p17666608.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to