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
posted 7 years ago
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.