Prevent browser from auto-downloading PDF Files

Prevent browser from auto-downloading PDF Files

by Niladri Das -
Number of replies: 6
Hi,
In my Moodle course settings, I have "disabled" the force download setting, but still the user is able to download the pdf file which is present in the course as a link to file. Certain download accelerators are also catching the url of the file.

How can i prevent users from automatically downloading pdf or any other files?

Thanks
_______________
Moodle version- 1.9.x
Bridged to Joomla v1.5.20 via Joomdle.
Average of ratings: -
In reply to Niladri Das

Re: Prevent browser from auto-downloading PDF Files

by Niladri Das -
Anyone help please?
In reply to Niladri Das

Re: Prevent browser from auto-downloading PDF Files

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
To view a PDF inside a web browser, you will need to make sure that every user has an appropriate plugin installed (most likely Adobe Reader) and that the web-browser settings are such that the PDF is set to view in the page, rather than being downloaded (the exact setting you need is dependent on the browser you are using). This will will only be possible if you have control over the browsers of everyone viewing the site (it is not possible to specify the browser behaviour from the server, it is only possible to give hints, such as 'force download'). Also, it will not prevent the 'Save a copy' link from appearing.

If you really want the content to be viewed in the browser, you should consider using the 'compose a webpage' feature, rather than posting the content as a PDF.
In reply to Niladri Das

Re: Prevent browser from auto-downloading PDF Files

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Why do you want to prevent the automatic download?
In reply to Marcus Green

Re: Prevent browser from auto-downloading PDF Files

by Vijay N -
On a related note, does anyone know how to show html files on a browser using Moodle. I tried to save my word document in htm or mhtm format but moodle does not recognise the format and produces a blank page.
In reply to Niladri Das

Re: Prevent browser from auto-downloading PDF Files

by jay bharat -

But yaar optiaanally I can download,  so this is not good solution,

 

MY QUESTION IS:

 

HOW TO PREVENT TO DOWNLOAD A .pdf FILE FROM SERVER.

In reply to jay bharat

Re: Prevent browser from auto-downloading PDF Files

by jay bharat -

Any one knows this answer

 


<FilesMatch "\.(pdf|doc)$">

and change the last line to:


</FilesMatch>