English 中文(简体)
固定资源的使用控制
原标题:Access control for static resources

在我的申请中,我有时会产生新的情况。 阅读评论here 我决定把图像储存在档案系统和数据库中的元数据中,因此,现在,我的档案是固定的,独立于数据库之外(这使用户拥有他们想要查阅的档案名称,然后从静态档案中取出)。

然而,我在此提出的问题是,我并不总是希望用户看到其他用户的照片。 例如,请说,用户Joe产生A和B的图像,用户Sue制造C和D。 我不想让Joe看到C和D,而我不想见到Sue。 由于所有档案都是静态送达的,如果Joe想方 the,他可以查阅。

由于图像的提供方式远远不能控制我的jan,我不敢确定这里的解决办法是什么,而只是对档案进行加密(复杂而且资源密集)。

最佳回答

简便的方法是使用django发送_file ? 这容易执行,但规模不大。 我利用它来为充满活力的报告服务。 这一解决办法的唯一好处是它符合所有平常法。

更好的方式是利用有关桑玛联线的信息。 http://www.sensibledevelopment.com/ 具体资料可查。

http://djangosnippets。

问题回答

作为图像途径的一部分,使用一种或多种MD5冲积物;道路将十分随意。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签