wood burning stoves 2.0*
The moose likes Struts and the fly likes File uploading issue with Firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File uploading issue with Firefox" Watch "File uploading issue with Firefox" New topic
Author

File uploading issue with Firefox

Gilbert Debattista
Greenhorn

Joined: Apr 05, 2005
Posts: 19
Hiya ranchers,
I'm trying to check the mime type when uploading a file such that only ms-word files can be uploaded. This checking is being done in the validate method inside the form bean. Here's a snippet from my code :

jsp ->


form bean ->


The problem is that when using Mozilla Firefox to upload the file using the form, the content type returned by getContentType() is "application/x-download" for MS Word documents, while whenever i use MSIE it returns a valid "application/msword". Can somebody please point out if i'm doing anything wrong or if this is just an issue with Firefox?

Thanks in advance
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
"Gillinu",

Welcome to JavaRanch. We don't have many rules, here, but we do have a naming policy which we strictly enforce. Please re-read this policy and then edit your display name in order to comply. Thanks in advance and we look forward to seeing you around the Ranch.
Gilbert Debattista
Greenhorn

Joined: Apr 05, 2005
Posts: 19
Ok Jason, name changed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File uploading issue with Firefox