header information in image file uploaded via php curl library
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=------------开发者_StackOverflow社区----------------4954a272dea2 )
Is the server not handling the request correctly or is it my (the client's) problem?
See my previous reponse on troubleshooting CURL. Let me know if you need some more clarification.
cURL not returning anything?
精彩评论