Our API is only available for registered users
POST VARIABLES :
user = your login
pass = your password
local_directory = directory containing the file Ex: /var/www/
filename = name of the file you want to upload
Api Code
<?
$user='Login';
$password='Password';
$local_directory=dirname(__FILE__).'/';
function curl_exo($url,$filename=0,$action=0){
global $user,$password,$local_directory;
if (!function_exists('curl_init')){
die('Sorry cURL is not installed!');}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, "http://www.exoshare.com/");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
if($action=='upload') {
$post_array = array(
"file_0"=>"@".$local_directory.$filename,
"user"=>$user,
"password"=>$password
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);
}
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
$dlink= curl_exo('http://www.exoshare.com/upload.php','filename','upload');
echo $dlink;
?>