'Want to protect file from copy,download

I have following requirement.

Admin can upload any files like jpg,pdf,PPT,DOC file on server.

End User or viewer only access the files in display/view mode. User shouldn't to be allowed to copy/paste/download/print/modify files.

Please suggest me some way in doing this in PHP or any kind of Editor which gives me such kind of services so that I can embed my application to it.

-Pravin



Solution 1:[1]

If the user can VIEW the file then how can you make the difference between VIEW and DOWNLOAD ?

Answer: you can't.

To view a file, the browser should download it and store into it's local cache. You do not have any way to prevent this.

What you can do is to restrict the access to the directory (or the resources) with a htacess security asking username/password.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 fluminis