本文介绍了显示公用文件夹外部的多个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开展一个项目,我希望出于版权原因将照片存放在安全的地方。用户可以将他们的照片上传到公共路线('www')以外的文件夹。

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').

对于已登录的用户,我想允许浏览这些照片。
我想使用'imagecreatefromjpeg'和'imagejpeg',但它们只能填满整个网页。如果我想将图像打开到弹出窗口中,那只会很好。
而不是这样做,我想在屏幕上显示小缩略图(在上传时生成,也存储在私人文件夹中)。

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?

感谢您帮我解决。

推荐答案

您可以使用php gd缓存已提交图像的缩略图

You can cache thumbnails of the submitted images with php gd

然后创建一个将提供图像的image.php文件(放入您自己的身份验证中以确保安全访问)将以 imagejpg($ im)结束。

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

然后在你的html中,只需输入:

Then in your html, just put something like:

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

这篇关于显示公用文件夹外部的多个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 14:52