kinlane
4/13/2012 - 4:56 AM

IDrive - EVS - REST API - uploadFile

IDrive - EVS - REST API - uploadFile

$uid = "[your IDrive user ID]";	
$pwd = "[your IDrive user password]";
$crtpath = "[a path to your local cert]";

$pvtkey = "[your private key]";	
$p = "[path in your account where file will be upload]";
			
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->data['weburl'].'/evs/uploadFile');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);

$body = 'uid=' . $uid. '&pwd=' . $pwd.'&p='. $p .'&pvtkey=' . $pvtkey;

curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('multipart/form-data'));
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_CAINFO,$crtpath);

$output = curl_exec($ch);

curl_close($ch);