how to download File directly into server?

Discussion in 'Site & Server Administration' started by Jeehan, Jan 11, 2009.

  1. #1
    Hello,
    I am trying to upload files directly into the server without downloading in my pc then upload to server. How can i do this?? Like a file is located in www.anysite.com/sample.exe. without downloading the file into my pc then upload it it will be downloaded into the server. help plz
     
    Jeehan, Jan 11, 2009 IP
  2. rldowling03

    rldowling03 Notable Member

    Messages:
    1,763
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    200
    #2
    use the following command in your shell in the directory you want the file downloaded to

    wget http://www.anysite.com/sample.exe
    Code (markup):
    Or if you dont have Shell Access, use this php code, just put it in download.php and run it from your web browser after uploading it to the server

    <?php
    
    $url = "http://www.anysite.com/sample.exe"; // URL of file you want to download
    $file = "sample.exe"; // File to save it as on the server
    
    $ch = curl_init($url);
    $fp = fopen($file, 'w');
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_exec($ch);
    curl_close($ch);
    fclose($fp);
    
    ?>
    Code (markup):
     
    rldowling03, Jan 11, 2009 IP
    Jeehan likes this.
  3. richu

    richu Peon

    Messages:
    460
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I was in the same situation like you. I have started a thread that time and did find some cool answers for that. Well, if i am right - i think someone suggested flashfxp - which is an ftp client that helps us do just that. Yes, i have tried that myself and was successful.
     
    richu, Jan 11, 2009 IP
  4. cpamethods

    cpamethods Banned

    Messages:
    100
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if possible, u may try Leapftp, i used Leapftp software before, not bad
     
    cpamethods, Jan 11, 2009 IP
  5. Jeehan

    Jeehan Well-Known Member

    Messages:
    1,578
    Likes Received:
    31
    Best Answers:
    1
    Trophy Points:
    115
    #5
    WOW THANK YOU Guys.
     
    Jeehan, Jan 11, 2009 IP