Heim  >  Artikel  >  Backend-Entwicklung  >  php curl post二进制数据流图片的数据格式

php curl post二进制数据流图片的数据格式

WBOY
WBOYOriginal
2016-06-06 20:29:013982Durchsuche

<code>$key = "file\"; filename=\"1.jpg\r\nContent-Type: image/jpeg\r\n";
$fields[$key] = $file;</code>

用curl post $fields数组 提交二进制流图片

可是对方服务器提示获取不到信息

求教格式哪里有错误

回复内容:

<code>$key = "file\"; filename=\"1.jpg\r\nContent-Type: image/jpeg\r\n";
$fields[$key] = $file;</code>

用curl post $fields数组 提交二进制流图片

可是对方服务器提示获取不到信息

求教格式哪里有错误

CURL上传文件完整篇

CURL函数之上传 | 下载文件

http://php.net/manual/en/function.curl-file-create.php

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn