1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

WGET to download file

Discussion in 'PHP' started by alphacooler, Jan 2, 2007.

  1. #1
    Here is a script I found to download files using the commandline and WGET. But unfortunately the comments of the orig programmer aren't quite enough for me to understand.

    Here is the script:

    http://www.zend.com/tips/tips.php?id=91&single=1

    I know where the path to wget on my server (/usr/bin/wget), but i'm not sure what to put in the following:

    • $destination-path
    • $url (url of file I want to d/l presumably)
    • /path-to-outfile/output
    • $temp = `/path-to-cat/cat /path-to-outfile/output`;

    I guess I am not sure of the "format" I need to enter for these vars.

    Perhaps a dummy example would be of help.

    Thanks so much.
     
    alphacooler, Jan 2, 2007 IP
  2. saadahmed007

    saadahmed007 Admínistratör

    Messages:
    5,272
    Likes Received:
    869
    Best Answers:
    0
    Trophy Points:
    380
    #2
    Mostly all linux distros have wget installed by default or you can install it with this command
    yum install wget
    or via rpm command
    rpm -qi wget
    Hope it helps :)
    Saad
     
    saadahmed007, Jan 2, 2007 IP
  3. alphacooler

    alphacooler Peon

    Messages:
    70
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah I have wget installed (as mentioned above), but I just can't get it to work.

    Anyone have an example of how to download a simple image:

    exec("/usr/bin/wget http://fly.srk.fer.hr/jpg/flyweb.jpg");

    For instance, that should work, but doesn't.
     
    alphacooler, Jan 2, 2007 IP
  4. saadahmed007

    saadahmed007 Admínistratör

    Messages:
    5,272
    Likes Received:
    869
    Best Answers:
    0
    Trophy Points:
    380
    #4
    saadahmed007, Jan 2, 2007 IP
  5. alphacooler

    alphacooler Peon

    Messages:
    70
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    wget is located in "/user/bin/wget" for me. Thus I the example I posted right before your post did that right?
     
    alphacooler, Jan 2, 2007 IP
  6. saadahmed007

    saadahmed007 Admínistratör

    Messages:
    5,272
    Likes Received:
    869
    Best Answers:
    0
    Trophy Points:
    380
    #6
    As far as i know, it doesn't matter where wget is installed if it is installed properly it should work with word wget :eek: correct me if i am wrong :eek:
    Saad
     
    saadahmed007, Jan 2, 2007 IP