Im trying to post to a multipart html form using CURLs CURLOPT_POSTFIELDS, but I cannot find out how to post it with no files.
When testing the form in normal browser, the "File" field can be empty, "Name" and "Message" can not.
This works:
$array = array(
"Name" => "Jon",
"Message" => "My package was broken, please send new.",
"File" => "@look_omg_its_broken_omgomg_look_at_the_corners.jpg"
);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $array);
This doesnt:
$array = array(
"Name" => "Jon",
"Message" => "My package was broken, please send new.",
"File" => ""
);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $array);
$output = curl_exec($ch);
This last $output results in a bool(false) I have also tried these variations of values, but no success.
"File" => "@"
"File" => "@/"
"File" => NULL
"File"
"File" => array("")
"File" => array("filename" => "")
Anyone know better?