The download from server form can be used to fetch an entire directory, which is then returned as a ZIP file.
---- Changes since 1.410 ----
Added fields for sending an email notification when a background download or file upload completes.
+---- Changes since 1.490 ----
+Added support for extracting LHArc format files when uploading.
index_done=Download complete
index_imm=Immediately
index_asuser=As user
-index_zip=Extract ZIP or TAR files?
+index_zip=Extract archive or compressed files?
index_zipyes=Yes, then delete
index_header3=Download file from server to PC
index_fetch=File to download
email_extdone_tar=TAR file extracted
email_extdone_tgz=Gzipped TAR file extracted
email_extdone_tbz2=Bzipped TAR file extracted
+email_extdone_lha=LHArc file extracted
email_upfile=Original filename: $1
email_uppath=Destination filename: $1
email_upsize=Uploaded size: $1
local @files;
&switch_uid_back();
if ($path =~ /\.zip$/i) {
+ # ZIP file
if (!&has_command("unzip")) {
$err = &text('upload_ecmd', "unzip");
}
$fmt = "zip";
}
elsif ($path =~ /\.tar$/i) {
+ # Un-compressed tar file
if (!&has_command("tar")) {
$err = &text('upload_ecmd', "tar");
}
}
$fmt = "tar";
}
+ elsif ($path =~ /\.(lha|lhz)$/i) {
+ # LHAarc file
+ if (!&has_command("lha")) {
+ $err = &text('upload_ecmd', "lha");
+ }
+ else {
+ open(OUT, &command_as_user($uinfo[0], 0, "(cd $qdir && lha xf $qpath)")." 2>&1 </dev/null |");
+ while(<OUT>) {
+ $out .= $_;
+ if (/(\S[^\t]*\S)\s+\-\s+/) {
+ push(@files, "/".$1);
+ }
+ }
+ close(OUT);
+ $err = $out if ($?);
+ }
+ $fmt = "lha";
+ }
elsif ($path =~ /\.(tar\.gz|tgz|tar\.bz|tbz|tar\.bz2|tbz2)$/i) {
+ # Compressed tar file
local $zipper = $path =~ /bz(2?)$/i ? "bunzip2"
: "gunzip";
if (!&has_command("tar")) {