[英]Failed to load resource: the server responded with a status of 404 (Not Found) Laravel on Heroku
[英]file path returning Failed to load resource: the server responded with a status of 404 (Not Found)
我收到此错误消息
无法加载资源:服务器响应状态为404(未找到)
我有一个文件class_start_paperwork.php
文件,在include文件夹中创建pdfs和jpgs到私人文件夹
所以
我试图在user_group_start_paperwork_esign2.php
文件中显示图像,该文件位于public_html文件夹中
"/root
/private
/scratch
/1387.2742.1487969899-0.jpg"
"/public_html
/include
/class_start_paperwork
/user_group_start_paperwork_esign2.php"
它正在创建图像
我只是无法加载jpgs
<img src= '../private/scratch/1387.2742.1487969899.0.jpg' width=800 height=1100 />
是页面源中的内容
好像/ private文件夹在公共世界区域之外。 您必须将/ private文件夹的内容移动到公共区域并重新链接以使Web浏览器能够访问。
如果您要使用服务器端语言显示图像,则可能具有正确的权限。
这个答案有一些很好的信息: 从私人目录显示图像
理想情况下,您只需要访问该目录,但如果这绝对不可能,那么您可以这样做:
myimage.php
$ file ='privatedir / image.jpg'; $ type ='image / jpeg'; 报头(“内容类型:” $型); header('Content-Length:'。filesize($ file)); ReadFile的($文件); 出口();
然后使用myimage.php作为img标签src。
这很完美
myimage.php
$ file ='privatedir / image.jpg'; $ type ='image / jpeg'; 报头(“内容类型:” $型); header('Content-Length:'。filesize($ file)); ReadFile的($文件); 出口();
然后使用myimage.php作为img标签src。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.