GPX Upload Client

From OpenStreetMap Wiki
Jump to: navigation, search

Took a bit of trial and error with the cURL options to write a GPX upload client using PHP/cURL, but anyway, this does work:


$url = "";
$ch=curl_init ($url);
$formvars = array
        "description"=>"Henley to Chithurst via Older Hill and Stedham",
        "tags"=>"West_Sussex footpaths",

curl_setopt ($ch, CURLOPT_HTTPHEADER,array("Expect:"));
curl_setopt ($ch,CURLOPT_USERPWD,"$username:$password");
curl_setopt($ch,CURLOPT_POST,1 );

echo "Response: $resp, HTTP code: $httpCode";