Was wondering for some free plus good filehost better then Rapidshare or Mediafire. & ShareShiz named me Bayfiles.com
I have been using it from yesterday & am kind of loving it. Totally awesome. Anyways some of the members were asking for RL upload plugin to Bayfiles.com. here it is along with a function if u has custom script. It uses Bayfiles' API
RL PLUGIN
Cheers :D
I have been using it from yesterday & am kind of loving it. Totally awesome. Anyways some of the members were asking for RL upload plugin to Bayfiles.com. here it is along with a function if u has custom script. It uses Bayfiles' API
PHP:
echo uploadBF("./temp.txt");
function uploadBF($x,$retry=0)
{
$user="";
$pass="";
if(trim($user)!="" && trim($pass)!="")
{
$page=curl('http://api.bayfiles.com/v1/account/login/'.$user.'/'.$pass.'');
$page=json_decode($page);
$session=$page->session;
$page=curl("http://api.bayfiles.com/v1/file/uploadUrl?session=$session");
}
else
{
$page=curl("http://api.bayfiles.com/v1/file/uploadUrl");
}
$page=json_decode($page);
$url=$page->uploadUrl;
$page=curl($url,array('file'=>"@$x"));
$page=json_decode($page);
$url=$page->downloadUrl;
if($url=="" && $retry!=1)
return uploadBF($x,1);
else
return $url;
}
function curl($link, $postfields = '')
{
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.7.62 Version/11.01');
if($postfields)
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
}
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 1200);
$page = curl_exec($ch);
curl_close($ch);
return($page);
}
RL PLUGIN
Code:
http://bayfiles.com/file/1tXr/AuQnIB/bayfiles-rl-plugin.rar
Cheers :D
Last edited: