Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About MIME types

 
tong yuxin
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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)?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic