Results 1 to 10 of 10
Threaded View
-
23rd Dec 2011, 02:42 PM #10Retired NinJaWebsite's:
loledhard.comworkaround until api problem is sorted out...
PHP Code://To get the link
echo uploadfsc(getcwd()."/x.txt",'manohar_pandey@yahoo.co.in','Random');
//function code
function uploadfsc($x,$email,$pass){
$var = curl('http://api.filesonic.com/upload?method=getUploadUrl&u='.$email.'&p='.$pass,'');
preg_match('/"http:(.*?)"/',$var,$match);
$url = trim(stripslashes($match[0]),'"');
$post = array('files[]' => "@$x");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, trim($url));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$result = curl("http://www.filesonic.com/user/login",array('email'=>$email,'password'=>$pass,'redirect'=>'/','rememberMe'=>'1','controls[submit]'=>'submit'), "", true);
preg_match_all("/Set-Cookie: (.*?) /",$result,$matches);
$cookie="";
for($i=count($matches[1])-1;$i>=0;$i--)
{
$match = $matches[1][$i];
$cookie_var = str_ireplace(strrchr($match,'='),"",$match);
if (stripos($cookie,$cookie_var)===false)
$cookie.=$match;
}
$result = curl("http://www.filesonic.com/filesystem/browse/D0/1",array('queryString'=>basename($x)),$cookie.'fs_orderFoldersBy=date;fs_orderFoldersDirection=desc;');
preg_match('/<input type="checkbox" (.*?) rel="(.*?)"(.*?)\s*(.*?)"'.basename($x).'">/i',$result,$match);
if($match[2]!="")
return "http://www.filesonic.com/file/".$match[2];
else
return "";
}
function curl($url, $postdata, $cookie = "", $header = false)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
if($header == true)
curl_setopt($ch, CURLOPT_HEADER, 1);
if($cookie != "")
{
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
if($postdata != "")
{
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 1200);
$source_code = curl_exec($ch);
curl_close($ch);
return $source_code;
}
You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
sborg error
By vincentfkc in forum File Host DiscussionReplies: 0Last Post: 13th Dec 2011, 04:22 AM -
How to install sborg or other script on new VPS without getting apache error?
By desibreaker in forum Tutorials and GuidesReplies: 4Last Post: 9th Jul 2011, 01:40 PM -
Sborg Torrent Error
By aggiefury101 in forum Technical Help Desk SupportReplies: 8Last Post: 23rd Jun 2011, 09:59 PM -
Sborg Parse Error
By aggiefury101 in forum Technical Help Desk SupportReplies: 13Last Post: 4th Jun 2011, 08:26 PM -
FileSonic <==> SBorg
By KonnectPlus in forum Technical Help Desk SupportReplies: 14Last Post: 18th Jan 2011, 06:10 PM
themaCreator - create posts from...
Version 3.55 released. Open older version (or...