Activity Stream
48,167 MEMBERS
61180 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member
    Website's:
    satiq.net

    Default Check if upload failed

    Hi,

    which is the best way to check if 1 upload, for example to RS, failed and then reup again?

    Thanks
    skinner Reviewed by skinner on . Check if upload failed Hi, which is the best way to check if 1 upload, for example to RS, failed and then reup again? Thanks Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    First, how you upload?

  4.     
    #3
    Member
    Website's:
    satiq.net
    For example, I use that functions:

    PHP Code: 
    <?php
    /*
    Upload to Share-online with cUrl
    Fixed By: AdelSBM
    */


    //----------------------------------
    $user="0123456789";  // Username
    $pass="HgHFGhFsfS";    // Password

    $filelocation="999.rar";  // file Path
    //-----------------------------------

    shareonlinebizupload($filename,$filelocation,$user$pass); // Let's upload


    function shareonlinebiz_getsession($user,$pass){

        
    $url "http://www.share-online.biz/upv3_session.php";
        
    $postdata = array();
        
    $postdata['username'] = $user;
        
    $postdata['password'] = $pass;
        
    $strpage curl_func($url,$postdata,'','',0);
        return 
    $strpage;
    }    


    function 
    shareonlinebizupload($filename,$filelocation,$user$pass){    
        
    $data shareonlinebiz_getsession($user,$pass);
        
    $data explode(';',$data);
        
    $fpost = array();
        
    $fpost["username"] = $user;
        
    $fpost["password"] = $pass;
        
    $fpost["upload_session"] = $data[0];
        
    $fpost['chunk_no'] = '1';
        
    $fpost['chunk_number'] = '1';
        
    $fpost['filesize'] = filesize($filelocation);
        
    $fpost['fn'] = "@".$filelocation;
        
    $fpost["finalize"] = "1";    
        
        
    //printr($fpost);
        
    $server 'http://'.$data[1];
        
    //echo $server;
        
    $page curl_func($server,$fpost,'','',0);
        
    $data explode(';',$page);
        
    $download_link=$data[0];
        echo 
    $download_link;
    }  
    function 
    curl_func($link$postfields ''$cookie ''$refer ''$header 1$follow 1$usragent ''){

        
    $ch curl_init($link);
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        if(
    $header)
            
    curl_setopt($chCURLOPT_HEADER1);
        else
            
    curl_setopt($chCURLOPT_HEADER0);         
        if(
    $follow)
            @
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
       else
           @
    curl_setopt($chCURLOPT_FOLLOWLOCATION0); 
        if(
    $usragent)    
           
    curl_setopt($chCURLOPT_USERAGENT$usragent);
        else
            
    curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
        
        if(
    $refer)
            
    curl_setopt($chCURLOPT_REFERER$refer);
            
        if(
    $postfields){
            
    curl_setopt($chCURLOPT_POST1);
            
    curl_setopt($chCURLOPT_POSTFIELDS$postfields);
        }
        if(
    $cookie){
            
    curl_setopt($chCURLOPT_COOKIEJAR$cookie);
            
    curl_setopt($chCURLOPT_COOKIEFILE$cookie);
        }
        
    curl_setopt($chCURLOPT_HTTPHEADER, array('Expect:'));
        
    $page curl_exec($ch);

        
    curl_close($ch);

        if(empty(
    $page)){
            echo 
    "<br/>Could not connect to host: <br/> $link <br/>";
            
    //die();
        
    }
        else{
            return 
    $page;
        }


    ?>

  5.     
    #4
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    you can try to use stristr function

    PHP Code: 
    $download_link shareonlinebizupload($filename,$filelocation,$user$pass); // Let's upload
    if(stristr($download_link,'share-online.biz')) echo 'uploaded';
    else echo 
    'failed'//or upload again 

  6.     
    #5
    Member
    Website's:
    satiq.net
    Quote Originally Posted by t3od0r View Post
    you can try to use stristr function

    PHP Code: 
    $download_link shareonlinebizupload($filename,$filelocation,$user$pass); // Let's upload
    if(stristr($download_link,'share-online.biz')) echo 'uploaded';
    else echo 
    'failed'//or upload again 
    So I have to add

    PHP Code: 
    $download_link shareonlinebizupload($filename,$filelocation,$user$pass); 
    in the ELSE?

  7.     
    #6
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    PHP Code: 
    $retrytimes 3;
    $i 0;
    do {
        
    $i++;
        
    // upload and check, if succeeded then use break to exit loop;
    } while ($i $retrytimes); 

  8.     
    #7
    Member
    Website's:
    satiq.net
    Instead, if I set timeout in function, how can I check if that timeout it's ended and retry upload?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 20
    Last Post: 6th Jun 2012, 03:41 PM
  2. FacePalm Failed!
    By XForce! in forum General Discussion
    Replies: 0
    Last Post: 18th May 2011, 09:51 AM
  3. I have failed with passwords.ws :(
    By ViPeRR in forum Webmaster Discussion
    Replies: 25
    Last Post: 31st Jan 2011, 12:46 AM
  4. The camera man failed
    By Daniel in forum General Discussion
    Replies: 12
    Last Post: 28th Jun 2010, 05:05 PM
  5. CyberHack failed
    By iKnow in forum General Discussion
    Replies: 29
    Last Post: 26th Dec 2009, 12:12 PM

Tags for this Thread

BE SOCIAL