• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File uploading issue with Firefox

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok Jason, name changed
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic