通过phpcurl库上传的图像文件中的头信息
我正在使用php的curl库来上传图像。我有一个问题。图像文件中似乎保存了一些标头信息,只有删除这些标头信息才能查看图像。
------------------------------------------4954a272dea2^M 内容处置:表单数据;名称=“文件”;文件名=“WorkingMan1122.jpg”^M 内容类型:image/jpeg^M ^M 接下来是图像,
我查看了请求的标头,它看起来像:
Array ( [Authorization] => Basic ZGF2aWRwK2FwaV91c2VyQHpvb3NrLmNvbTzl1bVV5RzNyTnNydU1Ma1VNQ0ZpS0pzeXY= [Host] => www.....com [Accept] => / [内容长度] => 220803 [预期] => 100-继续 [内容类型] => 边界=---------- ------------------4954a272dea2 )
是服务器没有正确处理请求还是我(客户端)的问题?
I am using php's curl library to upload images. I have a problem. It seems that some header information is saved in the image file and the image can't be viewed until these are removed.
------------------------------4954a272dea2^M
Content-Disposition: form-data; name="file"; filename="WorkingMan1122.jpg"^M
Content-Type: image/jpeg^M
^M
followed by the image
I looked at the header of the request and it looks like:
Array ( [Authorization] => Basic ZGF2aWRwK2FwaV91c2VyQHpvb3NrLmNvbTzl1bVV5RzNyTnNydU1Ma1VNQ0ZpS0pzeXY= [Host] => www.....com [Accept] => / [Content-Length] => 220803 [Expect] => 100-continue [Content-type] => application/binary; boundary=----------------------------4954a272dea2 )
Is the server not handling the request correctly or is it my (the client's) problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅我之前关于 CURL 故障排除的回复。如果您需要更多说明,请告诉我。
cURL 不返回任何内容?
See my previous reponse on troubleshooting CURL. Let me know if you need some more clarification.
cURL not returning anything?