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 Ned Collyer wrote: > > Thanks, > > Raised as https://issues.apache.org/jira/browse/WICKET-1684 > > Curiously mentioned in https://issues.apache.org/jira/browse/WICKET-300 > but marked as resolved/invalid. > > Rgds > > Ned > > > igor.vaynberg wrote: >> >> argh, didnt read closely enough. yes that is the right way to do it, >> in fact you shouldnt have to do that at all, fileuploadfield should be >> doing that... >> >> please create a jira ticket, that component is pretty old so it >> probably got overlooked. multifileuploadfield does it properly >> already. >> >> -igor >> > > ----- Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Best-way-of-validating-FileUploadField-tp17662018p17664375.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]
