简体   繁体   中英

Display multiple images from outside the public folder

Im working on a project, where I'd like to store photographs in a secured location for copyright reasons. Users can upload their photographs to a folder, outside the public route ('www').

For signed-in users, I'd like to allow to browse these photographs. I wanted to use 'imagecreatefromjpeg' and 'imagejpeg', but they could only fill the entire webpage. That would only be good, if I would want to open the images into a pop-up window. Instead of doing that, I'd like to have small thumbnails (generated on upload, also stored in private folders) all over my screen.

Is there any way to do that? Am I going in the worng direction with this?

Thanks for helping me out.

You can cache thumbnails of the submitted images with php gd

http://www.fliquidstudios.com/2009/05/07/resizing-images-in-php-with-gd-and-imagick/

Then create a image.php file that will serve images (put in your own authentication to secure access) that will end with imagejpg($im) .

Then in your html, just put something like:

<img src="images/image.php?id=123" width="100" height="100">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM