我需要通过curl在post请求中发送多个文件,但是我需要通过相同的密钥来识别它们。像下面的东西
------WebKitFormBoundaryyFeHAIcdy1Bny0xj
Content-Disposition: form-data; name="blah[attachments][][resource]"; filename="abc.png"
Content-Type: image/png
------WebKitFormBoundaryyFeHAIcdy1Bny0xj
Content-Disposition: form-data; name="blah[attachments][][resource]"; filename="def.jpg"
Content-Type: image/jpeg
我目前正在这样做
$abc['blah[attachments][][resource]'] => new CurlFile($pathToImage,'image/jpeg')
适用于单个文件,但如何为多个文件发送上述请求?