Cheat Codes - Find jobs - Kamala Harris - Online Advertising - Find jobs

PDA

View Full Version : WGET to download file


alphacooler
Jan 2nd 2007, 11:18 am
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.

saadahmed007
Jan 2nd 2007, 11:20 am
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

alphacooler
Jan 2nd 2007, 12:12 pm
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.

saadahmed007
Jan 2nd 2007, 12:19 pm
just do
wget http://www.example.com/example.jpg
Saad
:) :)

alphacooler
Jan 2nd 2007, 12:20 pm
wget is located in "/user/bin/wget" for me. Thus I the example I posted right before your post did that right?

saadahmed007
Jan 2nd 2007, 12:24 pm
As far as i know, it doesn't matter where wget is installed if it is installed properly it should work with word wget :o correct me if i am wrong :o
Saad