php在另一个磁盘上的localhost之外读取图像 [英] php read images outside localhost on another disk

查看:433
本文介绍了php在另一个磁盘上的localhost之外读取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这个学习项目将只在本地运行

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?

推荐答案

在使用apache网络服务器时,请查看

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屋!

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