PHP-cURL code with multiple uploaded files

I have a request with multiple files on a variable called files. The request runs correctly in Postman. I need it to run in PHP.

The Generated PHP-cURL code looks wrong. It contains:
CURLOPT_POSTFIELDS => array(‘files’=> new CURLFILE(‘SOrf7-JsS/file1.csv’),‘files’=> new CURLFILE(‘MXudzPgrW/file2.csv’), …

That’s duplicate keys in a PHP array.

Hey @joint-operations-p14 :wave:

Welcome to the Postman Community! :postman:

Glad to see this is working for you in Postman - This sounds like it’s probably better asked on Stackoverflow or a PHP specific Community. :sweat:

Doing a quick search, I found something like this but I wouldn’t know if it works:

$postFields = array(
    'files[]' => new CURLFile('file.jpeg'),
    'files[]' => new CURLFile('file.png')
);

CURLOPT_POSTFIELDS => $postFields,

I have no doubt that there are some PHP masters in this Community but you might get a faster solution if this is posted elsewhere. :pray: