什么是隐藏在服务器上的文件的最好方法是什么?器上、文件、方法

2023-09-02 00:41:06 作者:Autism゛陌亡

我要做出的图片托管系统,在PHP。 我想知道我应该从用户隐藏我的图片,使他们只能通过特殊的URL来访问。

I am going to make an image hosting system in PHP. I wondered how I should hide my images from users so they can only be accessed through a special url.

我需要讨论,其中包括htaccess的所有技术。

I need to discuss all techniques that include htaccess.

推荐答案

我会preFER而不是有一个PHP程序发送的文件和生猪服务器资源长期而其发送内容的..创建一个脚本将文件复制过来的目录有一个随机的名字,然后就将该文件发送给用户,并且设定的时间间隔后有另一个脚本清除出该目录..如果创建时间超过30分钟..删除..这样ü尽量减少ü只需要一个apache进程发送,而不是APACHE + PHP程序的文件。

i would prefer that instead of having a PHP process send the file and hog server resources for long while its sending the content.. create a script which copies the file over to a directory with a random name and then just send that file to the user and have another script clear out that directory after set intervals .. if creation time older than 30 mins .. delete .. that way u minimize u just need an apache process to send back the file instead of apache + php process.

 
精彩推荐