I have a script that uses NET::SSLeay to connect to an apache webserver using SSL to download files from the site,
based on following links in the pages. The issue is how SSLeay implements grabbing pages/files from sites. As far as I know, the only way to do this is:
($page, $result, %headers) =
Net::SSLeay::get_https("aaa.bbb.com", 443, "/data/file.gz",
Net::SSLeay::make_headers('Authorization' =>
'Basic ' . MIME::Base64::encode("$user:$pass"))
);
# print downloaded file into local file
open(FILE, "file.gz");
print FILE $page;
close FILE;
The problem is downloading large files (hundreds of megs). I get a very friendly Out of memory! error. Are there other ways to use SSLeay to download directly to a file, or to redirect a variable to a file handle of some sort, or use unix piping to get around this?
To stave off inevitable questions of why I'm using SSL, the system must be very secure, and giving unix accounts to use SCP or the like to a large number of users was not considered a good idea by the security folk here.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.