jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes About MIME types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "About MIME types" Watch "About MIME types" New topic
Author

About MIME types

tong yuxin
Greenhorn

Joined: Jul 21, 2008
Posts: 19
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)?


SJCP 98%
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About MIME types