分享一点代码(小型C web开发框架)共11篇章 (含全部源代码),范例:用C语言实现的一个WEB 文件下传
发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
分享一点代码(小型C web开发框架)共11篇章 (含全部源代码),范例:用C语言实现的一个WEB 文件上传
分享一点代码(小型C web开发框架)共11篇章 (含全部源代码),范例:用C语言实现的一个WEB 文件上传
在 windows IIS Apache linux Apache IE Firefox 均测试通过
编译:用Vs2008和GCC 均可编译
共11篇章 (含全部源代码),欢迎各位专家,高手指正!
#include "cgic.h"
#define BufferLen 1024
int cgiMain(void){
int i = 0;
char fn[1024];
char type[1024];
char name[1024];
char **responses;
cgiFilePtr file;
FILE *fp;
int targetFile;
char fileNameOnServer[64];
char contentType[1024];
char buffer[BufferLen];
char *tmpStr=NULL;
int size;
int got,t;
cgiHeaderContentType("text/html");
fprintf(cgiOut, "<title>C WEB</title>n");
fprintf(cgiOut, "<h1>C语言开发</h1>n");
fprintf(cgiOut, "<br>cgiServerSoftware %s n", cgiServerSoftware);
fprintf(cgiOut, "<br>cgiServerName %s n", cgiServerName);
fprintf(cgiOut, "<br>cgiGatewayInterface %s n", cgiGatewayInterface);
fprintf(cgiOut, "<br>cgiServerProtocol %s n", cgiServerProtocol);
fprintf(cgiOut, "<br>cgiServerPort %s n", cgiServerPort);
fprintf(cgiOut, "<br>cgiRequestMethod %s n", cgiRequestMethod);
fprintf(cgiOut, "<br>cgiPathInfo %s n", cgiPathInfo);
fprintf(cgiOut, "<br>cgiPathTranslated %s n", cgiPathTranslated);
fprintf(cgiOut, "<br>cgiQueryString %s n", cgiQueryString);
fprintf(cgiOut, "<br>cgiRemoteHost %s n", cgiRemoteHost);
fprintf(cgiOut, "<br>cgiRemoteAddr %s n", cgiRemoteAddr);
fprintf(cgiOut, "<br>cgiAuthType %s n", cgiAuthType);
fprintf(cgiOut, "<br>cgiRemoteUser %s n", cgiRemoteUser);
fprintf(cgiOut, "<br>cgiRemoteIdent %s n", cgiRemoteIdent);
fprintf(cgiOut, "<br>cgiContentType %s n", cgiContentType);
fprintf(cgiOut, "<br>cgiAccept %s n", cgiAccept);
fprintf(cgiOut, "<br>cgiUserAgent %s n", cgiUserAgent);
fprintf(cgiOut, "<br>cgiReferrer %s n", cgiReferrer);
cgiFormString( "fn", fn , sizeof( fn ) );
cgiFormString("type", type, sizeof( type ));
cgiFormString("name", name, sizeof( name ));
fprintf( cgiOut , "<br/>fn:" );
fprintf( cgiOut , fn );
fprintf( cgiOut , "<br/>type:" );
fprintf( cgiOut , type );
fprintf( cgiOut , "<br/>name:" );
fprintf( cgiOut , name );
if(strcmp(cgiRequestMethod, "GET")==0)
{
fprintf(cgiOut, "<form target='_blank' method='post' enctype='multipart/form-data' > ");
fprintf(cgiOut, " <input name='file' id='file' type='file' /> <input name='submit' type='submit' /> ");
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
风生水起才知天高云淡,沧海横流方显英雄本色 百万商业圈云平台免费发布,几十万台电脑变成一台不是梦
百万商业圈分布式云平台功能...
-
登录问题
登录服务器为A 、代理服务器为B 、服务器资源为C.
http发送 验证成功 https请求资源
1.A<---...
-
集群的问题
看了网上很多文章,不是很理解怎么集群的,一下又memcache集群的,一下又mysql集群,还有什么nginx
。
具我了解nginx起的作用...
-
关于计费系统里面的预付费和后付费概念
由于本人刚接触计费系统,对里面的一些概念还有点模糊,特别是对预付费和后付费的理解,我的问...
-
很幽默的讲解六种Socket IO模型(转)
本文简单介绍了当前Windows支持的各种Socket I/O模型,如果你发现其中存在什么错误请务必赐教...
-
数据库读写分离时候可能碰到的问题
数据库读写分离后,如果碰到一种插入操作,是需要对数据做检索后再进行的
例如用户注册,需要检测用...
-
奇怪啊,为何我的一个SWF浏览器缓存文件会被自动清除
我已经设置了这个文件的max-age是100天,也就是说,这个文件会在浏览器缓存里放10...
-
Myfaces日历控件无法弹出
代码如下:
<x:inputCalendar monthYearRowClass="yearMonthHeader"
weekRowClass="w...
-
到底什么才是Web Services
我曾经做过一个android的软件,当时的思想是这样的,我用SSH框架做了一个Web服务端,这个服务端暴露了很多的...
-
Web服务和文件服务分离后的问题
(A是Web服务器,B是文件服务器)
1 A网络映射B,访问A上传文件到B通过映射的路径实现。显示B中的...