简体   繁体   English

访问cgi-bin中的图像

[英]access an image in cgi-bin

I have a quick question regarding my assignment for school. 关于我的上学任务,我有一个简短的问题。 So essentially it is a webform and I upload a photo and some info, and the .cgi file populates the data into a profile. 因此,从本质上讲,这是一个网络表单,我上传了一张照片和一些信息,.cgi文件将数据填充到个人资料中。 I got it working when I upload the image to "public_html/images" folder, however the assignment requires me to upload and retrieve the image from "public_html/cgi-bin/assn1/images". 当我将图像上传到“ public_html / images”文件夹时,它可以正常工作,但是作业要求我从“ public_html / cgi-bin / assn1 / images”上传和检索图像。 The image uploads to both the "public_html/images" and the "../cgi-bin/assn1/images". 图像上传到“ public_html / images”和“ ../cgi-bin/assn1/images”。 However, in the case of the latter, I can't retrieve it. 但是,对于后者,我无法检索它。 Can someone please give me some information as to how I could go about doing this? 有人可以给我一些有关如何执行此操作的信息吗? Also this is the school server so I am limited to what I can do... 这也是学校的服务器,所以我只能做我能做的...

profile photo.... <img src="../assn1/images/$fileName">

Any help would be appreciate it. 任何帮助将不胜感激。 Thank you in advance. 先感谢您。

Cheers 干杯

What, exactly, do you mean by "I can't retrieve it"? 确切地说,“我无法检索”是什么意思? Are you getting some kind of error message or a missing image icon? 您是否收到某种错误消息或缺少图像图标? Is anything being written to the web server error log? 是否将任何内容写入Web服务器错误日志?

It's possible that the web server is configured so that everything under the /cgi-bin directory is interpreted as a CGI program. 可能已经配置了Web服务器,以便将/ cgi-bin目录下的所有内容解释为CGI程序。 In which case, you shouldn't be storing static content there. 在这种情况下,您不应该在那里存储静态内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM