• 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

About MIME types

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just read the section 4 of " head first Servlet and JSP"
and worte a small Servelet to achieve download of pdf from server.
I set the content type as "response.setContentType("application/pdf");"
finally, it works. But I just wondering:

if the other client's browser is not support for pdf.
1.do i use setContentType("application/pdf") can add a new mine type to their browser?

2.if not, how to make it works? could something possible to change the client's browser MIME type?

3. if we can use something to add a new MIME type to Client's Browser, is it can cause the security problem? just like pass them the .exe file and run it that will be dangerous(like pass virus)?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding handlers for different mime types to a browser has to be under the control of the browser owner - otherwise it would be a huge security hole.

Many security disasters have been due to users accepting code offered as a special media/mime type playing plugin.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic