php在另一个磁盘上的localhost之外读取图像 [英] php read images outside localhost on another disk
问题描述
好的,这个学习项目将只在本地运行
ok, this learning project will run only localy
winxp + Service Pack 3
winxp + service pack 3
xampp + PHP:5.2.0
xampp + PHP: 5.2.0
根文件夹:localhost/demo(C:\ Program Files \ xampp \ htdocs \ demo)
root folder: localhost/demo (C:\Program Files\xampp\htdocs\demo)
我需要在我的根目录中运行一个脚本,该脚本将向我显示同一台计算机(不是网络驱动器,不是共享的)上另一张硬盘上的图像
i need to run a script in my root, that will show me images from another hard disc on the same computer (not network drive, not shared)
文件路径为:G:/folder1/folder2/folder3/file
the path of the files is: G:/folder1/folder2/folder3/file
我无法指向该文件直接加载到演示应用程序中
I cannot point to that file to load directly into my demo application
如果是图片,请显示
如果是txt,请打开
等
这完全有可能还是所有文件都应该位于根文件夹中?
is this possible at all or should all files be inside root folder?
推荐答案
As you use the apache websever, take a look into the Alias
directive Docs - that's exactly what it is for.
Alias /files G:/folder1/folder2/folder3
然后您可以通过http://localhost/files/...
访问folder3内的所有文件.
You can then access all files inside folder3 via http://localhost/files/...
.
这篇关于php在另一个磁盘上的localhost之外读取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!