CGI文件上传脚本问题 [英] CGI file upload script problems

查看:48
本文介绍了CGI文件上传脚本问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前可能已经介绍过,但找不到类似的帖子。


基本上我创建了一个表格,可以在 www.icomworks.co.uk/canvaspayform.html


我想提交表单和文件,以便它们都放在我的server ...我在我的public_html中创建了一个名为myscripts的文件夹,并将upload.cgi脚本保存到该文件夹​​中。我的表单指向该脚本但是当我填写表单并提交表单时,我收到以下错误消息。


内部服务器错误


服务器遇到内部错误或配置错误,无法完成您的请求。

请与服务器管理员联系, webmaster @ icomworks .co.uk 并告知他们错误发生的时间,以及可能导致错误的任何事情。


有关此错误的更多信息可能是在服务器错误日志中可用。


我已经给出了脚本具有正确权限的文件夹(755)并且我有上传路径我认为指向正确的文件夹..


这里是表单和脚本的代码

This has probably been covered before but could not find a similar thread.

Basically I have created a form which can be viewed at www.icomworks.co.uk/canvaspayform.html

I want to submit the form along with the file so that they are both placed on my server... I have created a folder on my server in my public_html called myscripts and have saved my upload.cgi script into that folder. my form points to that script but when I fill in the form and submit the form I get the following error message.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@icomworks.co.uk and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

I have given the folder which the script is in the right permissions (755) and I have the upload path "i think" pointing to the right folders..

here are the code for the form and the script

展开 | 选择 | Wrap | 行号

推荐答案

您的Web主机应该有一些关于如何在其服务器上运行cgi脚本的实例。由于我们不知道主机是如何配置的,因此很难做出一些非常一般的建议:


以ASCII(文本)模式上传脚本

将权限(chmod)设置为755

一般将cgi脚本上传到cgi-bin,而不是上传到你在public_html文件夹中创建的文件夹中,虽然这可能是可能但你必须问你的网站主持人。
Your web host should have some instuctions on how to run cgi scripts on their servers. Since we do not know how the host is configured it is hard to make anything but very general suggestions:

upload the script in ASCII (text) mode
set permissions (chmod) to 755

generally you upload cgi scripts into the cgi-bin, not into a folder you create in your public_html folder, although that might be possible but you have to ask your web host.


谢谢你的回复凯文,


我已经将权限设置为755,我知道你对这个问题的看法是什么脚本进入cgi-bin但是服务器管理员告诉我把它放在public_html的一个单独的文件夹中,因为服务器所在的pipex不喜欢它们存储在那里..


你能在我的脚本中看到任何错误吗?


我希望上传的图像进入public_html文件夹中名为canvasimages的文件夹。我的脚本中的路径是正确的吗?


当图像和表格提交时,表格联系方式还会在哪里?


我将与服务器管理员进行另一次聊天明天看看他们说了什么..


再次感谢
Thanks for the reply Kevin,

I have set the permissions to 755 and I know what your saying about putting the script into the cgi-bin but the server admin told me to put it in a seperate folder in the public_html because pipex who the servers are with do not like them being stored there..

Can you see any errors in my script?

I want the images once uploaded to go into a folder called canvasimages in the public_html folder. is the path right in my script?

Also where will the form contact details go when the image and the form is submitted?

I will have another chat with the server administrator tomorrow to see what they say..

thanks again


所有这些?在你编写的代码中让我觉得你的mac编辑器在文件中投入了大量额外的数据,而不应该存在。 Perl脚本必须以纯文本(ASCII)格式保存。不要使用任何文字处理格式。但我不知道有关mac电脑的废话,所以不能真正建议你应该做什么。
All those "?" in the code you ppsted make me think that your mac editor is throwing in lots of extra data into the file that should not be there. Perl scripts must be saved in plain text (ASCII) formatted files. Don''t use any word processing formats. But I don''t know crap about mac computers so can''t really suggest what you should do.


这篇关于CGI文件上传脚本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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