所以我试图模仿以下内容:
------WebKitFormBoundarygLmTBM5HATvn9tpA
Content-Disposition: form-data; name="name"
p1bieoilebde1ra71v4tm2rlb3h.png
------WebKitFormBoundarygLmTBM5HATvn9tpA
Content-Disposition: form-data; name="file"; filename="watch.png"
Content-Type: image/png
------WebKitFormBoundarygLmTBM5HATvn9tpA--
我的代码看起来像这样
$cfile = new CURLFile(realpath(dirname(__FILE__) . "/../images/watch.png"));
$to_post = array ('file' => $cfile);
curl_setopt($ch, CURLOPT_POSTFIELDS, $to_post);
它没有用,有什么帮助吗?