Tag: 文件上传

上传和POST文件到PHP页面

我需要一种方法来上传文件并将其发布到php页面 php在apache服务器上 我在我的桌面应用程序中使用此c代码: 它是c代码的套接字 当我执行程序时,可以得到 文件大小是772906 open server ok文件大小是772906连接到服务器ok打开文件ok fread 102400 bytes,发送102400字节fread 102400字节,发送102400字节fread 102400字节,发送102400字节fread 102400字节,发送102400字节fread 102400发送102400字节fread 102400字节,发送102400字节fread 102400字节,发送102400字节fread 56106字节,发送56106字节发送文件完成! 结果:返回代码: 上传: 类型: 大小:0 Kb 临时文件: 存储在: 但文件不存在。 我想也许它可能是HTTP协议,但我不知道该怎么做。 你能告诉我细节吗? 非常感谢。 #include #include #include #include #include #include #include #include #include #include #include #include int main(){ int sockfd, numbytes; FILE *fp; char buf[300]; char filename[10]=”1.jpg”; char send1[100]; […]