I know it's possable, just not a clue how I would even start it...
To feed a script a URL and have it pull down all the links to .zip files and download the .zip files to the server...
Does anyone know how, or have a clue where to find a script like this
Download... a question for the experts
Moderator: General Moderators
Re: Download... a question for the experts
(assuming apache is used), this would depend on the "Indexes" option of the apache configuration. This directive allows/disallows the user to view the entire contents of a directory if there is no DirectoryIndex file present (such as index.html or index.php). if this is a server that you administer, i'd be happy to show you how to set apache to allow such a thingromeo wrote:I know it's possable, just not a clue how I would even start it...
To feed a script a URL and have it pull down all the links to .zip files and download the .zip files to the server...
Does anyone know how, or have a clue where to find a script like this
<edit>
oops, i guess i misread the question...i was thinking you were looking to download all zip files in a given directory
</edit>
Last edited by will on Mon Jun 24, 2002 10:11 am, edited 1 time in total.
It's possible.
Just retrieve the document and parse it for <a> and </a> tags. When it finds those, parse for file type. Make a list of the hits (so to speak), then go back and download those files.
Check out this link. http://www.php.net/manual/en/function.fsockopen.php.
Look at example one and build from there.
Later on,
BDKR (TRC)
Check out this link. http://www.php.net/manual/en/function.fsockopen.php.
Look at example one and build from there.
Later on,
BDKR (TRC)
So like this
The First part I think I can handle.. the sockets however confuse me...
does
download the zip file?
does
Code: Select all
<?php
$fp = fsockopen ("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com/tough.zip");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>download the zip file?