Uploading Files

Hi all,

Hoping you can help, have a very simple piece of code and can’t for the life of me figure out why it doesn’t work. I’ll link the code and then the error! Seems like the key for “file” isn’t recognised for whatever reason?

$PIPEDRIVE = array(
$curl = curl_init($URL);
$Headers = [
‘Content-Type: multipart/form-data’,
‘Cache-Control: no-cache’
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $Headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

echo ‘Sending request…’ . PHP_EOL;

$output = curl_exec($curl);

echo $output;

JSON Response

“error”: “Invalid input: file - This field was not expected.”,

You might find the following wiki useful

Feel free to create a new topic if you still face challenges.