You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mohan rao <mo...@gmail.com> on 2011/07/18 23:22:52 UTC

struts2 There is a bug in FileUploadInterceptor (FileContentType).

I'm trying to rescrit a file being Upload based on FileContentType. I'm
facing browser compatability issue. Suppose if i have to allow only jar
files (application/java-archive) but i'm getting different contentTypes for
different browsers. Like x-zip compressed, application-octstream for the jar
fileContentType. So, i tried allowed extension types (jar) it's working
fine. But the if user changed the extension of a text file [.txt to .jar].
It will fail and it's foolproof. How can i fix this problem? 

--
View this message in context: http://struts.1045723.n5.nabble.com/struts2-There-is-a-bug-in-FileUploadInterceptor-FileContentType-tp4601250p4601250.html
Sent from the Struts - User mailing list archive at Nabble.com.

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


Re: struts2 There is a bug in FileUploadInterceptor (FileContentType).

Posted by Ankit Jain <mr...@gmail.com>.
Hi,

If anybody can let me know some good user doc which tells how to add
validations using validator framework in struts2.

thanks

ankit

Re: struts2 There is a bug in FileUploadInterceptor (FileContentType).

Posted by Maurizio Cucchiara <ma...@gmail.com>.
I often use the
MimetypesFileMap<http://download.oracle.com/javase/6/docs/api/javax/activation/MimetypesFileTypeMap.html>

On 19 July 2011 08:52, mohan rao <mo...@gmail.com> wrote:

> can you please give me name that library jar file.
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/struts2-There-is-a-bug-in-FileUploadInterceptor-FileContentType-tp4601250p4611321.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Maurizio Cucchiara

Re: struts2 There is a bug in FileUploadInterceptor (FileContentType).

Posted by mohan rao <mo...@gmail.com>.
can you please give me name that library jar file.

--
View this message in context: http://struts.1045723.n5.nabble.com/struts2-There-is-a-bug-in-FileUploadInterceptor-FileContentType-tp4601250p4611321.html
Sent from the Struts - User mailing list archive at Nabble.com.

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


Re: struts2 There is a bug in FileUploadInterceptor (FileContentType).

Posted by Dave Newton <da...@gmail.com>.
Use a file type sniffer library.

Dave
 On Jul 18, 2011 10:06 PM, "mohan rao" <mo...@gmail.com> wrote:
> I'm trying to rescrit a file being Upload based on FileContentType. I'm
> facing browser compatability issue. Suppose if i have to allow only jar
> files (application/java-archive) but i'm getting different contentTypes
for
> different browsers. Like x-zip compressed, application-octstream for the
jar
> fileContentType. So, i tried allowed extension types (jar) it's working
> fine. But the if user changed the extension of a text file [.txt to .jar].
> It will fail and it's foolproof. How can i fix this problem?
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/struts2-There-is-a-bug-in-FileUploadInterceptor-FileContentType-tp4601250p4601250.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>