欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

为何用Delphi程序写的POST不能下传图片

程序员文章站 2022-05-02 16:20:26
...
为何用Delphi程序写的POST不能上传图片?
我用Delphi写了个POST,想实现自动上传的功能,但是就算我把整个提封包完全模拟下来,也不能成功提交图片,求高手帮忙解答!

以下是PHP的代码
PHP code
 FileUpload
上传文件: 已经成功上传
"; if($imgpreview==1) { echo "
图片预览:
"; echo "为何用Delphi程序写的POST不能下传图片"; } } ?>



以下是正常网页提交,和Delphi写的程序POST提交的截包
XML code
POST /aa.php HTTP/1.1Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, */*Referer: http://116.254.216.83/aa.phpAccept-Language: zh-cnContent-Type: multipart/form-data; boundary=---------------------------7dc38a1d60e20Accept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)Host: 116.254.216.83Content-Length: 37420Connection: Keep-AliveCache-Control: no-cache-----------------------------7dc38a1d60e20Content-Disposition: form-data; name="upfile"; filename="C:\Documents and Settings\Administrator\妗岄潰\Test\789_3.jpg"Content-Type: image/pjpeg??==================以上是网页提交截取的封包==========================================以下是Delphi程序提交截取的封包========================POST /aa.php HTTP/1.1Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, */*Referer: http://116.254.216.83/aa.phpAccept-Language: zh-cnContent-Type: multipart/form-data; boundary=---------------------------7dcbbd440b68Accept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)Host: 116.254.216.83Connection: Keep-AliveContent-Length: 37630Cache-Control: no-cache---------------------------7dcbbd440b68Content-Disposition: form-data; name="upfile"; filename="D:\Test\789_5.jpg"Content-Type: image/pjpeg??
为何用Delphi程序写的POST不能下传图片

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频