English 中文(简体)
如何限制用户查阅关于吉大港山区服务器的档案?
原标题:How to restrict user access the file on the HTTP Server?

我撰写了一个网络应用程序,使用户能够将其档案上载。 文档将在用户点击“上载荷”纽特服务器后上载。 用户可以通过从路程中取回档案......例如:。 http://www.demo.com/user/abc/download/the_file.jpg

但我发现,所有人都能通过这条道路进入这一档案。 我怎么做,或者是否有更好的办法管理档案,即只有登记用户或档案所有人才能下载档案?

最佳回答

由于业绩问题,直接在文字中提供档案并非一种选择,而且由于记忆限制,实际上不可能为BAIG提供档案。

The best option is to use the Apache module mod_xsendfile. The idea is to redirect all requests to a PHP/Perl/Python script which will just set a HTTP header saying "Hey Apache, serve this file instead" and mod_xsendfile will take care of it.

客户将无法在没有这种认证的情况下下载档案。

问题回答

如果你希望用户继续在档案系统的道路上查阅档案,那么如果使用像pache httpd这样的材料,你可以使用“htaccess”文档,并拥有向用户或团体提供的目录。

如果你锁定目录,并附有管理文件交付的文字,你可以核对文字许可,并向用户提供所要求的档案或403份。

我倾向于使用文字方法,因为它使我对许可的管理方式和更为复杂的准入情景有了更大的控制。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签