0

I was stuck with the same problem but it looked like the 'Content-Type: multipart/form-data' or adding @ did not resolve the issue.

References: how to upload file using curl with php

Community
  • 1
  • 1
user 923227
  • 2,528
  • 4
  • 27
  • 46

1 Answers1

1

The only change here is we have to use the function CurlFile in place of @.

For multiple filesuse multiple tags:

$data['<Filetag1>'] = new CurlFile('<Filename1>');
$data['<Filetag2>'] = new CurlFile('<Filename2>');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
user 923227
  • 2,528
  • 4
  • 27
  • 46