[Tomcat, HTTPD, Servlets & JSP] - mime type problem
by kuvera
I have a servlet that generates a pdf file, and returns it inline to be displayed by the browser:
res.setContentType("application/pdf");
res.setHeader("Content-disposition", "inline; filename=arajanlat.pdf");
bos = new BufferedOutputStream(out);
// Simple read/write loop sends the bytes
Sometimes the browser brings up the Adobe Reader plugin, but more frequently it displays a Save As window, saying the mime type is application/octet-stream.
It used to work all the time in standalone Tomcat. The server-wide web.xml contains the pdf mime type. Can you give me a hint?
Another question: even if the plugin shows, if I want to save the pdf, the offered filename will be the servlets path, not the filename I specified above. Is there a solution for this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029317#4029317
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029317
19Â years, 1Â month