Code:
<?php
$file = "temp.txt";
$description = "temp file description";
$post_vars = array();
$post_vars['desc'] = "$description";
$post_vars['file'] = "@$file";
$url = 'http://dl084.zshare.net:3000/';
$return = http_post_form($url, $post_vars);
$ere = explode("zshare.net/download/",$return);
$sre = explode("/",$ere[1]);
$dlink = "http://www.zshare.net/download/$sre[0]";
echo $dlink;
function http_post_form($url, $vars) {
$ch = curl_init();
$timeout = 0;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
$file_contents = curl_exec($ch);
curl_close($ch);
return $file_contents;
}
?>