get file on my server from a direct link

Discussion in 'PHP' started by wahba87, Feb 11, 2008.

  1. #1
    how can I put a file on my server from a direct link without downloading and reuploading .. ??

    thx in advance
     
    wahba87, Feb 11, 2008 IP
  2. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    What exactly do you mean by that?
     
    ToddMicheau, Feb 11, 2008 IP
  3. wahba87

    wahba87 Member

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    if there is a file in anysite.com/file.any

    I want to put it in my site as my-site.com/file.any

    without downloading and reuploading
     
    wahba87, Feb 11, 2008 IP
  4. bond1

    bond1 Active Member

    Messages:
    248
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    if you have ssh access to your host you can use wget
     
    bond1, Feb 11, 2008 IP
  5. fairuz.ismail

    fairuz.ismail Peon

    Messages:
    232
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    fairuz.ismail, Feb 11, 2008 IP
  6. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Ah, well if you want the file physically on your server you would need to upload the file to the server somehow. You could do this with a php script, curl() function, and automate the process. Or wget as bond1 said, as long as your able to get server side.
     
    ToddMicheau, Feb 11, 2008 IP
  7. wahba87

    wahba87 Member

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    that's exactly what I meant

    I'm asking who can I do this , what's the script , and what's "wget" , thx in advance
     
    wahba87, Feb 11, 2008 IP
  8. jnestor

    jnestor Peon

    Messages:
    133
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #8
    wget is a linux program that fetches web pages and stores them locally.

    If you have ssh access to your host you'd login and do something like:
    wget www.123.com/file.exe

    This would fetch the file and store it locally as file.exe. So if you do this in your websites home directory you could then access the file as www.yoursite.com/file.exe
     
    jnestor, Feb 11, 2008 IP
  9. wahba87

    wahba87 Member

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    ok I have something in the Cpanel called ssh , I created a new key but I don't know how to use it ?
     
    wahba87, Feb 11, 2008 IP
  10. Im The ONE

    Im The ONE Peon

    Messages:
    800
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Enter your SSH root using puTTy (google it). Use "cd home" etc commands to go into directory where you want the file.
    Write there "wget http://domain.com/file.rar" and it will start downloading that file to your server
     
    Im The ONE, Feb 11, 2008 IP
  11. wahba87

    wahba87 Member

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #11
    thaaaanks man so much :D , you helped me alot :)
     
    wahba87, Feb 11, 2008 IP
  12. yimplex

    yimplex Active Member

    Messages:
    108
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #12
    use putty or openSSH to do.
     
    yimplex, Feb 11, 2008 IP
  13. wahba87

    wahba87 Member

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #13
    seems that port 22 is closed , I e-mailed the server and waiting the reply

    thanks all :D
     
    wahba87, Feb 12, 2008 IP