.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "LWP-DOWNLOAD 1p" .TH LWP-DOWNLOAD 1p 2024-03-16 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME lwp\-download \- Fetch large files from the web .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& lwp\-download [\-a] [\-s] [] \& \& Options: \& \& \-a save the file in ASCII mode \& \-s use HTTP headers to guess output filename .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBlwp-download\fR program will save the file at \fIurl\fR to a local file. .PP If \fIlocal path\fR is not specified, then the current directory is assumed. .PP If \fIlocal path\fR is a directory, then the last segment of the path of the \&\fIurl\fR is appended to form a local filename. If the \fIurl\fR path ends with slash the name "index" is used. With the \fB\-s\fR option pick up the last segment of the filename from server provided sources like the Content-Disposition header or any redirect URLs. A file extension to match the server reported Content-Type might also be appended. If a file with the produced filename already exists, then \fBlwp-download\fR will prompt before it overwrites and will fail if its standard input is not a terminal. This form of invocation will also fail is no acceptable filename can be derived from the sources mentioned above. .PP If \fIlocal path\fR is not a directory, then it is simply used as the path to save into. If the file already exists it's overwritten. .PP The \fIlwp-download\fR program is implemented using the \fIlibwww-perl\fR library. It is better suited to down load big files than the \&\fIlwp-request\fR program because it does not store the file in memory. Another benefit is that it will keep you updated about its progress and that you don't have much options to worry about. .PP Use the \f(CW\*(C`\-a\*(C'\fR option to save the file in text (ASCII) mode. Might make a difference on DOSish systems. .SH EXAMPLE .IX Header "EXAMPLE" Fetch the newest and greatest perl version: .PP .Vb 3 \& $ lwp\-download http://www.perl.com/CPAN/src/latest.tar.gz \& Saving to \*(Aqlatest.tar.gz\*(Aq... \& 11.4 MB received in 8 seconds (1.43 MB/sec) .Ve .SH AUTHOR .IX Header "AUTHOR" Gisle Aas