Hi guy's...
I need a script (witout more lib's please)
to download a zip/jpg file from an website.
This is what i did' sofar,
But it's a little problem to 'filter' the htmltag's
when you execute this script it will start with output.
Date: Sun, 26 Jan 2003 05:53:34 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2
etc...
after the content/type he starts the download of the zipfile. and thats what i need to save.
---------
#!/usr/bin/perl
use Socket;
$rhost = "192.168.0.1";
$port = 80;
$iaddr = inet_aton($rhost);
$paddr = sockaddr_in($port, $iaddr);
socket(SOCK, AF_INET, SOCK_STREAM, $proto) || die "socket: $!";
connect(SOCK, $paddr) || die "connect: $!";
select(SOCK);
$| = 1;
select(STDOUT);
print SOCK "GET http://video/test.zip HTTP/1.0\015\012";
print SOCK "Pragma: no-cache\015\012";
print SOCK "Cache-Control: no-cache\015\012";
print SOCK "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\015\012";
print SOCK "\015\012\015\012";
while(<SOCK>) { print;
##
##
##
}
exit 1;
I need a script (witout more lib's please)
to download a zip/jpg file from an website.
This is what i did' sofar,
But it's a little problem to 'filter' the htmltag's
when you execute this script it will start with output.
Date: Sun, 26 Jan 2003 05:53:34 GMT
Server: Apache/1.3.26 (Unix) Debian GNU/Linux PHP/4.1.2
etc...
after the content/type he starts the download of the zipfile. and thats what i need to save.
---------
Code:
#!/usr/bin/perl
use Socket;
$rhost = "192.168.0.1";
$port = 80;
$iaddr = inet_aton($rhost);
$paddr = sockaddr_in($port, $iaddr);
socket(SOCK, AF_INET, SOCK_STREAM, $proto) || die "socket: $!";
connect(SOCK, $paddr) || die "connect: $!";
select(SOCK);
$| = 1;
select(STDOUT);
print SOCK "GET http://video/test.zip HTTP/1.0\015\012";
print SOCK "Pragma: no-cache\015\012";
print SOCK "Cache-Control: no-cache\015\012";
print SOCK "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\015\012";
print SOCK "\015\012\015\012";
while(<SOCK>) { print;
##
##
##
}
exit 1;