For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2004 > Get .exe or .zip file from the server via perl script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Get .exe or .zip file from the server via perl script
Nicolay A. Vasiliev

2004-07-28, 8:56 pm

Hello, there!

I need to implement the thing in the subject described.

Conceptually there are two steps:
1) logging into the system at some web-server;
2) getting some binary (zip or exe) and putthing this at my web-server.

I imagine approximately how can I implement the first step. But I don't
know anything how to download the file via perl script. Is this possible
at all?

Any help is very appreciated.

Thank you all in advance,
Nicolay.

--
---------------------
Nicolay A. Vasiliev

http://www.spamliquidator.com - Real spam fighter
http://www.soft411.com - Excellent soft archive
Gunnar Hjalmarsson

2004-07-28, 8:56 pm

Nicolay A. Vasiliev wrote:
> I don't know anything how to download the file via perl script.


This code, which I copied from a program of mine, may get you started:

open FILE, "< $dir/$file" or die "Can't open ... $!";
binmode FILE;
binmode STDOUT;
print "Content-Type: application/zip\n",
"Content-Disposition: attachment; filename=$file\n",
'Content-Length: ' . (stat "$dir/$file")[7] . "\n\n";
while (<FILE> ) { print }
close FILE;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Nicolay A. Vasiliev

2004-08-04, 8:55 pm

Hello, Gunnar!

Thanmk you and sorry for delay!

Gunnar Hjalmarsson wrote:
> Nicolay A. Vasiliev wrote:
>
>
>
> This code, which I copied from a program of mine, may get you started:
>
> open FILE, "< $dir/$file" or die "Can't open ... $!";
> binmode FILE;
> binmode STDOUT;
> print "Content-Type: application/zip\n",
> "Content-Disposition: attachment; filename=$file\n",
> 'Content-Length: ' . (stat "$dir/$file")[7] . "\n\n";
> while (<FILE> ) { print }
> close FILE;
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com