Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Howto transfer file from one server to another server online ?

  1. #1

    Howto transfer file from one server to another server online ?

    Hi,

    What I want to know is this :-

    Suppose there is a website which provides free songs. Also there is a link to the songs.

    Now, what if I want to copy them to my server? I don't want to download those BIG files to my computer and then again upload those BIG files to my server. I want to do it online without wasting any time of mine.

    Can it be done???

    Anyone? I think its possible using the command line ( SSH etc) !!

  2. #2
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    PHP Code:
    <?php
    define
    ('BUFSIZ'4095);
    $url 'http://www.example.com/example.zip';
    $rfile fopen($url'r');
    $lfile fopen(basename($url), 'w');
    while(!
    feof($rfile))
    fwrite($lfilefread($rfileBUFSIZ), BUFSIZ);
    fclose($rfile);
    fclose($lfile);
    ?>

    Change the $url value with the url of the file which you want to download..
    Just put this script in the folder where you want to download the file to.. Change the permissions of the folder to writable..
    Now just access the script url via your web browser and wait for the page to load completely, Once fully loaded, the remote file should be on your server..

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  3. #3
    Well, will it take the same time for doing the transfer this way like we do manually ?
    I mean suppose I want to transfer a 100 GB file, then how long with the page take to load completely?

  4. #4
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Could do some research on ssh + wget to download files I cant even say the script will work on your server. Or how fast it will download, but its faster then downloading and uploading. You can use another tab to continue about your business on the web.

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  5. #5
    Thanks for the info Mr.Bill

  6. #6
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    To make it easy log into your ssh and the cd to the directory you want the file to be put ie cd /home/intelli/downloads then using the wget command type in wget http://example.com/example.zip and your file will be saved in the folder you picked.

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  7. #7
    Using the php file to download large files would not work. You'd reach your server's max execution time well before a very large file could be completely downloaded.

    As Mr.Bill said in is second reply, wget would probably be the best bet. Or if the files are on ftp possibly an fxp transfer.

  8. #8
    I want to know whether the wget command would do it instantly or not? If it does instantly then its what I was looking for. Will it transfer instantly even big files?

  9. #9
    It can only transfer as fast as your server connection. If you've got a constant lets say 100Mps connection downloading a 100GB file it would take about 2 Hours 23 Minutes 9.93 Seconds to download that file. That's the theoretical fastest, with your connection using its full potential, which is hardly ever the case.

  10. #10
    So it's all about the speed of the sever right? and not about the speed of my internet connection? Correct me if I'm wrong.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 21 August, 2009, 22:52 PM
  2. Replies: 2
    Last Post: 14 May, 2009, 09:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •