如何用C语言编写CGI程序上传图片文件? [英] How to upload image file using cgi program written in c language?

查看:572
本文介绍了如何用C语言编写CGI程序上传图片文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要上传的server.I有只支持CGI的C程序作为服务器端HANDELING一个的GoAhead Web服务器。

I wanted to upload a jpeg image file on the server.I have a GoAhead web server which supports only cgi c program as a serverside handeling.

任何一个可以知道如何处理程序威滕HTTP发布图像文件中的CGI C语言?

Can any one know how to handle http posted image file in program witten in cgi in c language?

推荐答案

要获取POST数据刚读标准输入。环境变量CONTENT_LENGTH告诉你有多少期待,但当然,你需要让你的code具备应对任何潜在的恶意用户可以在你扔。

To get POST data just read stdin. Environment variable CONTENT_LENGTH tells you how much to expect but of course you need to make your code robust against whatever a potentially malicious user can throw at you.

这篇关于如何用C语言编写CGI程序上传图片文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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