wood burning stoves 2.0*
The moose likes Struts and the fly likes struts2 There is a bug in FileUploadInterceptor (FileContentType). Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 There is a bug in FileUploadInterceptor (FileContentType)." Watch "struts2 There is a bug in FileUploadInterceptor (FileContentType)." New topic
Author

struts2 There is a bug in FileUploadInterceptor (FileContentType).

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

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?


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: struts2 There is a bug in FileUploadInterceptor (FileContentType).
 
Similar Threads
properties file
Regarding WAR file
Difference between a WAR and a JAR file
javax resouce error
How to locate & write to files inside a Jar