什么是隐藏在服务器上的文件的最好方法是什么? [英] What is the best method to hide a file on a server?

查看:210
本文介绍了什么是隐藏在服务器上的文件的最好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要做出的图片托管系统,在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.

这篇关于什么是隐藏在服务器上的文件的最好方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆