0

I have a website where I am using PDFjs viewer to view the PDF. But Internet download manager or Download Accelerator Plus will prompt to download the content PDF. I want to prevent this download managers to download the content PDF.

Is there a way where we can disable this download managers using PHP/HTML?

Thanks.

raghavp
  • 31
  • 4

2 Answers2

0

I think you should send an HTTP header to the client. this header should be Content-disposition: inline; filename="name.pdf". this will show the pdf within browser instead of prompting for download, try it.

  • I am using pdfjs viewer where I have provided the url for the pdf to be displayed. When there is any download managers installed on the user system, then it grabs the link and give an option to download the same. I don't want the PDF to be downloadable to the user's system. He can only view the same using the viewer. – raghavp Jun 30 '14 at 09:09
  • I told you to force server to send the proper header – Ramin Omrani Jun 30 '14 at 09:11
  • I have a code like
    and in the Js i am passing url of the file as to the variable.
    – raghavp Jun 30 '14 at 09:28
0

Unfortunately, you cannot control client side behaviour. Even with headers set properly, it's all upto the browser (and its extensions) whether the attachment is rendered or downloaded.

Yes, you can try converting pdf to html, and then render that html, or you can give the scribd API a try as explained in this answer.

Community
  • 1
  • 1
Mukesh Soni
  • 1,119
  • 3
  • 13
  • 23