Freakshare upload function issue

Status
Not open for further replies.

t3od0r

Active Member
1,419
2008
183
10
I am trying to make a function to upload to freakshare but for the last hours i can't get a good result ....
my code:
PHP:
function freakshareupload($filename,$filelocation,$cookie,$username, $password){    

      $ref = "http://freakshare.com/";
    
    $page = curl($ref,'',$cookie,$ref);
    //echo '<textarea>'.htmlentities($page).'</textarea>';
    $url = cut_str($page, '<form action="','" method="post"');
    
    $fpost = array();
    $fpost["APC_UPLOAD_PROGRESS"] =  cut_str($page, 'name="APC_UPLOAD_PROGRESS" id="progress_key"  value="','"');
    $fpost["APC_UPLOAD_USERGROUP"] = cut_str($page, 'name="APC_UPLOAD_USERGROUP" id="usergroup_key"  value="','"');
    $fpost["UPLOAD_IDENTIFIER"] = cut_str($page, 'name="UPLOAD_IDENTIFIER" value="','"');
    $fpost["file"] = "@$filelocation";     
 
    $uid = 0; 
    $uid = rand_uid(32);
    $url=$url . '?X-Progress-ID=' . $uid;
    echo $url;
    printr($fpost);
    $page = curl_func($url,$fpost,$cookie,$ref,0);
       echo '<textarea>'.htmlentities($page).'</textarea>';

    
}
if i use $fpost["file"] i get "Fatal error: Cannot unset string offsets in /var/www/fs/x/upload.php on line 16"
if i use $fpost["file[]"] i get "no files"
 
5 comments
Try this. This should work.

PHP:
function freakshareupload($filelocation,$cookie,$username, $password){    

    $ref = "http://freakshare.com/";
    
    $page = curl($ref,'',$cookie,$ref);
    //echo '<textarea>'.htmlentities($page).'</textarea>';
    $url = cut_str($page, '<form action="','" method="post"');
    
    $fpost = array(
                    'APC_UPLOAD_PROGRESS' => cut_str($page, 'name="APC_UPLOAD_PROGRESS" id="progress_key"  value="','"'),
                    'APC_UPLOAD_USERGROUP' => cut_str($page, 'name="APC_UPLOAD_USERGROUP" id="usergroup_key"  value="','"'),
                    'UPLOAD_IDENTIFIER' => cut_str($page, 'name="UPLOAD_IDENTIFIER" value="','"'),
                    'file[]"; filename="' => basename($filelocation),
                    'file[]' => "@$filelocation" 
                    );
 
    $uid = 0; 
    $uid = rand_uid(32);
    $url=$url . '?X-Progress-ID=' . $uid;
    echo $url;
    printr($fpost);
    $page = curl_func($url,$fpost,$cookie,$ref,0);
       echo '<textarea>'.htmlentities($page).'</textarea>';

    
}

Note the extra filename variable in the $fpost array.

Freakshare shows me this:
glPqZ.png


Note: I removed 1 variable from your function $filename since it has no use in the function. So you may need to modify it
 
Status
Not open for further replies.
Back
Top