請問一下如何透過 curl 上載image給對方?
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: multipart/form-data; boundary=boundary;',
'Content-Length: ' . strlen($data_string))
);
因為對方不是 php 接收而是nodejs
如何實現跨server的文件上載?
有大神嗎
GCT1015
哔哔one