Please point me in the right direction (php download)

Discussion in 'PHP' started by AquAvia, Apr 30, 2008.

  1. #1
    Hi Group,

    I am desperately looking for help on a little script I require.
    I am trying to download pdf files from a remote server. I have looked at some examples from php.net, but nothing seems to work somehow.
    What I need is a function that takes a url (http://www.testserver.com/a.pdf or https://www.testserver.com/a.pdf or ftp.testserver.com/a.pdf) and downloads the file for local storage.

    Believe it or not, I am not trying to steal anything. This function is for backup purposes only. I know httrack does the trick for me easily, but I would prefer a php solution (function) that I can integrate in my script where I want it.

    some pointers in the right direction would be appreciated. If you happen to know how to fix this, a snippet would be fantastic.
    i.e.

    function get_document($url)
    {
    // get remote file and store locally
    return true
    }
     
    AquAvia, Apr 30, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    itcn, Apr 30, 2008 IP