1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

An amazing script which you can use while shifting hosts!

Discussion in 'Web Hosting' started by varundbest, Dec 23, 2009.

  1. varundbest

    varundbest Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 15, 2009
    Messages:
    763
    Likes Received:
    495
    Well when i was shifting from eprohosted to hostgator i was in a trouble and was thinking how to transfer all the files present in public_html. So i found an easy way for it! It is easy as 1, 2 and 3!
    First of all, compress all the files and folders in a .zip file.
    Then make a file called script.php inside the folder in which you want all the files (.zip file) to be.
    Then edit that file (script.php) and add these codes into it -
    Code:
    <?php
    define('BUFSIZ', 4095);
    $url = 'The address of the .zip file';
    $rfile = fopen($url, 'r');
    $lfile = fopen(basename($url), 'w');
    while(!feof($rfile))
    fwrite($lfile, fread($rfile, BUFSIZ), BUFSIZ);
    fclose($rfile);
    fclose($lfile);
    ?>
    ( make sure you enter the url of that .zip file)
    Then save the file (script.php) and visit the url of that file (script.php)
    It should be like -
    Code:
    http://yourdomain/thefolder/script.php
    And your file will be uploaded in that folder within seconds! (Time taken is according to the file size and the speed of your new server)

    HAVE FUN AND MERRY CHRISTMAS!
     
    • Thanks Thanks x 3
    Last edited: Dec 23, 2009
  2. gusso

    gusso Newbie

    Joined:
    Feb 21, 2009
    Messages:
    9
    Likes Received:
    2
    This should come in handy since I may be moving host.
     
  3. nicho

    nicho Regular Member

    Joined:
    Oct 17, 2007
    Messages:
    490
    Likes Received:
    686
    Occupation:
    Internet Marketer
    Location:
    UK
    Home Page:
    your script is ideal for people flipping websites
     
  4. varundbest

    varundbest Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 15, 2009
    Messages:
    763
    Likes Received:
    495
    Thanks and it can also used to enable remote upload feature in a website!
     
  5. WebStarr

    WebStarr Regular Member

    Joined:
    Feb 13, 2009
    Messages:
    212
    Likes Received:
    22
    You just made that work so easy. Thanks
     
  6. smallpile

    smallpile Newbie

    Joined:
    Jun 23, 2009
    Messages:
    39
    Likes Received:
    33
    Normally web hosting provider would provide back up and there is an area to specify new location of back up ... you could use it .. it faster ...
     
  7. Sleek

    Sleek Junior Member

    Joined:
    Apr 4, 2008
    Messages:
    107
    Likes Received:
    8
    it's nice script thanks for sharing
    I usually use WGET via SSH access but this script is great for shared host where you have no SSH access
     
  8. clfox

    clfox Regular Member Premium Member

    Joined:
    Sep 7, 2009
    Messages:
    459
    Likes Received:
    45
    Home Page: