Comments (3)
  • Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

1 gregorytesta commented Permalink

Chris --<br /> This could be useful for me, but I wasn't able to get it to go....when I click on the button...nothing happens. Is this code still current?<br /> Thanks,<br /> Greg

2 ChrisLaffra commented Permalink

That tinyurl is just a sample. Replace it with a URL to any other PDF ....

3 NikolaGereci commented Permalink

This works fine. But what if I don't want a download dialog. What if I want to open the pdf in a new browser tab when the user clicks a button? <br /> I use a servlet to get the pdf file to the browser to prevent the user from digging on the server hard drive directly. I also use the servlet to set the MIME type to application/pdf. <br /> When I set the response header to Content-disposition:attachment; filename.filename.pdf, I get the normal download dialog. <br /> But when I set it to inline, or remove it completely, nothing happens when I set the src attribute of the iframe to the URL of my servlet.