On Fri, 16 Jul 2010 10:26:11 -0400, Christopher Schultz
ch...@christopherschultz.net wrote:
If filename extensions are sufficient, you can get this information
directly from the servlet container using ServletContext.getMimeType.
There's also the activation framework's
We're using Struts 2 for file uploading, and we're filtering the types of
files people can upload by checking the file's content type against a list
of allowed mime types.
This turns out not to be reliable enough. Firefox in particular seems to
sometimes provide the wrong mime type, so
On 07/16/2010 04:21 PM, Stephen Turner wrote:
We're using Struts 2 for file uploading, and we're filtering the types
of files people can upload by checking the file's content type against a
list of allowed mime types.
This turns out not to be reliable enough. Firefox in particular seems to
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Manos,
On 7/16/2010 9:42 AM, Manos Batsis wrote:
On 07/16/2010 04:21 PM, Stephen Turner wrote:
We're using Struts 2 for file uploading, and we're filtering the types
of files people can upload by checking the file's content type against a
list of
My experience is that you cannot trust the mime-type supplied by the
browser on a file upload. The same file uploaded with FF or IE will
give you different mime-types. It's also dependent on what plugins
have been installed in the browser.
The only truly reliable methods would be to examine the
I've used this before, and it seemed to work well.
http://jmimemagic.sourceforge.net
Some more alternatives are here
http://www.rgagnon.com/javadetails/java-0487.html
--
Greg Akins
http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
6 matches
Mail list logo