$glumbo['user'] = 'USER';
$glumbo['pass'] = 'PASS';
$file = '/home/user/file_to_upload.txt';
$link = upGlumbo($file);
echo("The link of ".$file." is : ".$link."\n");
function upGlumbo($file) {
global $glumbo;
$default['glumbo'] = $glumbo;
$server = ftp_connect('ftp-upload.glumbouploads.com');
$logged = ftp_login($server, $glumbo['user'], $glumbo['pass']);
$upload = ftp_put($server, $file, $file, FTP_ASCII);
if($upload){
sleep(200);
$ch = curl_init("http://glumbouploads.com/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, "op=login&login=".$glumbo['user']."&password=".$glumbo['pass']);
curl_setopt($ch, CURLOPT_REFERER, 'http://glumbouploads.com/');
$url = curl_exec($ch);
preg_match_all('#Set-Cookie: (.*?);#', $url, $TMP);
$cookie = implode('; ', $TMP[1]).';';
$find = 0;
while(!$find){
curl_setopt($ch, CURLOPT_URL, "http://glumbouploads.com/?op=my_files");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
$url = curl_exec($ch);
preg_match_all('#<TR align=center>(.*?)</TR>#is', $url, $trs);
foreach($trs[1] as $tr){
preg_match('#<a href="(.*?)">(.*?)</a>#is', $tr, $matches);
$find += pathinfo($file, PATHINFO_BASENAME) == $matches[2] ? 1:0;
}
echo($find ? '':"File not found, wait 30s more.\n");
sleep($find ? 0:60);
}
curl_close($ch);
return($matches[1]);
}
return(FALSE);
}