Using curl to upload a file attachment
Summary:
Does anyone have the code to upload a file attachment by php.
Content (required):
Does anyone have the code to upload a file attachment by php. I keep getting "missing localfname" but cannot set it. Every example I can find, uses get_contents which doesn't work anymore.
Version (include the version you are using, if applicable):
Code Snippet (add any code snippets that support your topic, if applicable):
load_curl();
$curl = curl_init();
$url = 'http://www.adserversite.com/ads.php';
curl_setopt_array($curl,array(
CURLOPT_URL => $url,
CURLOPT_HEADER => 0,
CURLOPT_HTTPHEADER => "test",
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_CONNECTTIMEOUT => 20,