【发布时间】:2015-02-08 17:45:25
【问题描述】:
在这个项目中,我将管理员提交的文件上传到公共文件夹之外的文件夹中。
/web/ (the public folder)
/upload/ (uploading image to this which is at the same level as the public folder)
现在虽然我可以使用绝对 url (/www/userid/upload/) 上传,但我无法使用相对或绝对 url 回显相同的图像。
我尝试过<img src="/www/userid/upload/photo.jpg" /> 和<img src="../upload/photo.jpg" />,但没有一个有效。有什么提示吗?
【问题讨论】:
-
您不能在公用文件夹之外有 Web 引用,您必须将“上传”作为虚拟目录包含在您的 Web 服务器中。