This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

What is the MIME type for pdf files?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to save an attached pdf file from a message. But I should save it only after confirming that it is a pdf file. For that, I'm checking the mimetype as "APPLICATION/PDF". However, I'm unable to save the file because the mimetype is showing up as "APPLICATION/OCTET-STREAM".
Does anyone know?
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Kishore Sirivelu:
I'm trying to save an attached pdf file from a message. But I should save it only after confirming that it is a pdf file. For that, I'm checking the mimetype as "APPLICATION/PDF". However, I'm unable to save the file because the mimetype is showing up as "APPLICATION/OCTET-STREAM".
Does anyone know?


Yes thats true, when u receive a file via email or a webservice, the mimetype will show only as "APPLICAITON.OCTET-STREAM".
But you can check the file name and its extension by using getFileName() method, and then u can proceed further.. a temp solution.
 
Kishore Sirivelu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Balaji.
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!