php - Image security and linux file/directory permissions -


in php app allowing users upload photos. upon user upload, metadata stored in db , images stored in directory on linux server. want these images viewable when called through view can verify correct party viewing them. not want able enter url , view image.

/site    /framework    /protected  /**my php site**/    /www       /images  /**this storing images**/ 
  1. in order restrict viewing of these images need move images directory outside of www? if where?
  2. what linux permissions should given on images directory?
  3. for images have stored in db want restricted access use access rules within framework. can rules such these limit access images in given directory also?

any info can provided how approach (so can further research) answers questions above helpful.

for images in directory denied (they must access through script , none of them have direct access available - ie server able access them, , have apache mod_rewrite) can put .htaccess in directory following:

deny 

so answer questions number.. ^^

  1. no, .htaccess take care of same effect.
  2. you'll need read (+r) images server.
  3. the framework may have that, can't prevent direct linking if image url known. doing .htaccess or moving directory best bet.

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -