Announcement

Collapse
No announcement yet.

script to prevent direct download of images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • script to prevent direct download of images

    I have a subscriber only website that allows uploading of screenshots. Those images currently are not protected. Anyone that might know the path could potentially gain access to the images. I am interested in storing those images in a non public folder and allowing a php script to make the images available only to my logged in users when they click a link? Can anyone help me with this project?


    ___________________

    Orthohin

  • #2
    use .htaccess


    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?www\.yourallowdomain\.com/ [NC]
    RewriteRule .*\.(jpg|jpeg|gif|bmp|png)$ theimageyouwanttoshow [L]

    Comment

    Working...
    X