php - Temporarily make server file public -


i have joomla! site , each user have image. want keep image private user temporarily make (well, copy) public.

my thinking have user click link calls "publish.php" script. script take user name , create temporary (30 seconds) folder , copy private image temporary folder.

the script generate random key , build url using username , key i.e. www.site.com/photos/get_photo.php?key=username.*key*

then when goes link (via qr scanner) "get_photo.php" script check key valid , if display image.

i want photos public in sense given url can see not public in sense can keep polling server , dragging down photos , when become available.

i'm stuck security of original photos, if private script can't access them if public, if defeats purpose of making them temporarily public.

next problem generating key in 1 script can verified other script.

many guidance.

if going go through overhead of copying file, might have php script read , output file itself. i'm not sure how keeping track of images, if in database add column timestamp marks when has been made public. have script check timestamp see if made public within last 30 seconds. if has, file_get_contents on image, set appropriate image header , output it, if not maybe have load default error image.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -