transload via ftp

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    transload via ftp

    Ok, I wasn't gonna post this, but I was coding last week, n fiddling with uploading files via ftp to my server... So when I saw the transloader script, I figured why not post this too, updated the code a bit to add login to server, n here you guys go...

    DEMO: http://sendthoselinks.tk

    Added after 41 minutes:

    oh... n if you look for this line...

    PHP Code:
    $bob ftp_pasv($connectiontrue); 
    that sets it to passive mode, since some servers require this... If your server doesn't work with passive mode, disable/remove this line...
    I left it in, cause I never used a server that doesn't accept passive mode...
    Attached Files
    Last edited by pmbguy; 28.07.13, 08:24.
    C3 Themes: http://c3themes.wen.ru/index.html
    Find Files: http://mystarter.tk/?goto=X-search

    #2
    This is also file importer script , hope you like this too ..

    Posted this in my forum on a user request (Romanian lang)

    PHP Code:
    <?php 
    if(!empty($_POST['url'])&&
    !empty(
    $_POST['server'])&&
    !empty(
    $_POST['dir'])&&
    !empty(
    $_POST['user'])&&
    !empty(
    $_POST['pass']))
    {
    $file $_POST['url'];
    $ftp_server $_POST['server'];
    $dir $_POST['dir'];
    $ftp_user_name $_POST['user'];
    $ftp_user_pass $_POST['pass'];

    // open some file for reading
    $fp fopen($file'r');

    // set up basic connection
    $conn_id ftp_connect($ftp_server);

    // login with username and password
    $login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

    $name explode("/",$file);
    $name $name[count($name)-1];
    $name explode("?",$name);
    $name $name[0];

    // try to upload $file
    if (ftp_fput($conn_id,$dir."/".$name,$fp,FTP_BINARY)) {
        echo 
    "Successfully uploaded $file\n";
    } else {
        echo 
    "There was a problem while uploading $file\n";
    }

    // close the connection and the file handler
    ftp_close($conn_id);
    fclose($fp);
    }

    else{
    echo
    '<form action="" method="post">
    Fisier:<br/><input type="text" name="url"><br/>
    Server:<br/><input type="text" name="server"><br/>
    Folder:<br/><input type="text" name="dir" value="/public_html"><br/>
    User:<br/><input type="text" name="user"><br/>
    Parola:<br/><input type="text" name="pass"><br/>
    <input type="submit" name="Import">
    </form>
    '
    ;
    }
    ?>
    Attached Files
    This is ten percent luck, twenty percent skill
    Fifteen percent concentrated power of will
    Five percent pleasure, fifty percent pain

    And a hundred percent reason to remember the name!

    Comment


      #3
      ok, done a few updates as anyone who tested the demo recently might have noticed... added option to create directory, and option to set destination name too... So here's the update... Trying to get a folder view, but it's bugging out n I wanna watch GP again now, lol... Laters!!!
      Attached Files
      C3 Themes: http://c3themes.wen.ru/index.html
      Find Files: http://mystarter.tk/?goto=X-search

      Comment


        #4
        Originally posted by pmbguy View Post
        Ok, I wasn't gonna post this, but I was coding last week, n fiddling with uploading files via ftp to my server... So when I saw the transloader script, I figured why not post this too, updated the code a bit to add login to server, n here you guys go...

        DEMO: http://sendthoselinks.tk

        Added after 41 minutes:

        oh... n if you look for this line...

        PHP Code:
        $bob ftp_pasv($connectiontrue); 
        that sets it to passive mode, since some servers require this... If your server doesn't work with passive mode, disable/remove this line...
        I left it in, cause I never used a server that doesn't accept passive mode...
        : set_time_limit() has beenWarning
        disabled for security reasons in/
        home/u800315943/public_
        html/transloader/index.php
        on
        line51
        Error!!! Must enter URL to
        file...ftp.lifebd24.com
        FTP upload failed!
        Warning: ftp_close() expects
        parameter 1 to be resource, null
        given in/home/u800315943/
        public_html/transloader/
        index.php
        on line96
        Last edited by almahmud; 23.12.13, 07:04.

        Comment


          #5
          what file url did you try transfer, it should be a direct link... ie:

          C3 Themes: http://c3themes.wen.ru/index.html
          Find Files: http://mystarter.tk/?goto=X-search

          Comment

          Working...
          X