由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
BuildingWeb版 - 怎么可以隐藏图片文件路径?
相关主题
再问一个问题:password protected[转载] htpasswd
另一个问题,关于.htpasswd的Re: how to set up a password protection for accessing a certain hyperl
help请教高手:如何在html中创建link直接连到目录
How to use this htpasswd ?想在网页上加一部分只有member才能看到的
密码窗口一问what level is your Javascript skill?
logoff/logout怎么实现?如何为网页加入密码功能
浏揽协议怎样使UNIX下homepage目录下的内容
Any other ways to add password protection on NT server?哪位推荐一个静态页面的发布系统?
相关话题的讨论汇总
话题: webroot话题: imgaes话题: 路径话题: php话题: foldera
进入BuildingWeb版参与讨论
1 (共1页)
j*****o
发帖数: 320
1
在webroot/images/下有一堆JPG文件,命名都很规则:
webroot/imgaes/folderA/folderA001.JPG
webroot/imgaes/folderA/folderA002.JPG
...
webroot/imgaes/folderA/folderA00n.JPG
...
webroot/imgaes/folderB/folderB001.JPG
webroot/imgaes/folderB/folderB002.JPG
...
文件名字,路径和存取权限都在数据库里面,让PHP调用。当图片
在网页上显示的时候,根据就能看见图片名和路径。
现在需要防止未授权用户根据已有的文件路径猜测图片名和路径。
已知的办法是用Javascript加密HTML,但不是上上之选。最好也不用
Flash/Java Applet, 不要存图像到数据库里,也不要用Apache
的htaccess。
有什么别的办法么?谢谢。
m******t
发帖数: 2416
2

You can use php to serve the image files, instead of using static links.
Instead of putting the image file name in a link, put a random id, then in
your php program you can map that id to the actual file.

【在 j*****o 的大作中提到】
: 在webroot/images/下有一堆JPG文件,命名都很规则:
: webroot/imgaes/folderA/folderA001.JPG
: webroot/imgaes/folderA/folderA002.JPG
: ...
: webroot/imgaes/folderA/folderA00n.JPG
: ...
: webroot/imgaes/folderB/folderB001.JPG
: webroot/imgaes/folderB/folderB002.JPG
: ...
: 文件名字,路径和存取权限都在数据库里面,让PHP调用。当图片

j*****o
发帖数: 320
3
I failed to do so. Do you know if there has a sample?

【在 m******t 的大作中提到】
:
: You can use php to serve the image files, instead of using static links.
: Instead of putting the image file name in a link, put a random id, then in
: your php program you can map that id to the actual file.

m******t
发帖数: 2416
4

I can't get you a sample right now even though I'm sure people are using this
technique all over the Internet. 8-)
The basic idea is to serve images dynamically just like you serve the pages.

【在 j*****o 的大作中提到】
: I failed to do so. Do you know if there has a sample?
j*****o
发帖数: 320
5
I finally got it. One php file should use GD to output a pure picture
stream, and another use to display.
In this way, web user will never find out where pictures are stored.

【在 m******t 的大作中提到】
:
: I can't get you a sample right now even though I'm sure people are using this
: technique all over the Internet. 8-)
: The basic idea is to serve images dynamically just like you serve the pages.

c***r
发帖数: 4631
6
="../../../../imgserver/user/usr/bin/getImage.php?type=A&id=1&app=X&dir=0&user
=ESDFA342WS2w3SW#6">
Then use your php to read the image file from folder information from type and
file number with 1. others are just used to confuse crackers. And then just
output the every bite from the image file. Remeber to change the MIME type.
Don't just do redirect, people could figure this out easily.

【在 j*****o 的大作中提到】
: 在webroot/images/下有一堆JPG文件,命名都很规则:
: webroot/imgaes/folderA/folderA001.JPG
: webroot/imgaes/folderA/folderA002.JPG
: ...
: webroot/imgaes/folderA/folderA00n.JPG
: ...
: webroot/imgaes/folderB/folderB001.JPG
: webroot/imgaes/folderB/folderB002.JPG
: ...
: 文件名字,路径和存取权限都在数据库里面,让PHP调用。当图片

1 (共1页)
进入BuildingWeb版参与讨论
相关主题
哪位推荐一个静态页面的发布系统?密码窗口一问
请问,怎么改mime呀?logoff/logout怎么实现?
reseller hosting浏揽协议
apache中文问题。急!(不能修改httpd.conf)Any other ways to add password protection on NT server?
再问一个问题:password protected[转载] htpasswd
另一个问题,关于.htpasswd的Re: how to set up a password protection for accessing a certain hyperl
help请教高手:如何在html中创建link直接连到目录
How to use this htpasswd ?想在网页上加一部分只有member才能看到的
相关话题的讨论汇总
话题: webroot话题: imgaes话题: 路径话题: php话题: foldera