Why don't you make the กฐ fileman2.0" support กฐ zip" function, that will be very good!
Feb 18, 2002, 3:18 AM
Veteran (19537 posts)
Feb 18, 2002, 3:18 AM
Post #6 of 13
Views: 6898
Not all servers support unzipping.
You could create a simple routine to do it though if you have "unzip" installed on your server...
#-----------------------------------------
# Unzip a zip file.
my $file = shift;
my $path = locate_unzip() or die "Cannot locate unzip binary";
my $output = qx/$path $file/;
return $output;
}
sub locate_unzip {
#------------------------------------------
# Locate the unzip binary.
my @opts = qw(/bin/unzip /usr/bin/unzip /usr/sbin/unzip /usr/local/bin/unzip);
for (@opts) {
-x $_ and return $_;
}
return 0;
}
Well thats just a basic example...you'd probably need to make changes to get it to work with fileman.
You could create a simple routine to do it though if you have "unzip" installed on your server...
Code:
sub unzip { #-----------------------------------------
# Unzip a zip file.
my $file = shift;
my $path = locate_unzip() or die "Cannot locate unzip binary";
my $output = qx/$path $file/;
return $output;
}
sub locate_unzip {
#------------------------------------------
# Locate the unzip binary.
my @opts = qw(/bin/unzip /usr/bin/unzip /usr/sbin/unzip /usr/local/bin/unzip);
for (@opts) {
-x $_ and return $_;
}
return 0;
}
Well thats just a basic example...you'd probably need to make changes to get it to work with fileman.
Feb 18, 2002, 7:51 AM
Administrator (9387 posts)
Feb 18, 2002, 7:51 AM
Post #8 of 13
Views: 6884
Hi,
We are trying to keep FileMan pure perl, so we don't want to do anything that requires a system call, or depends on some program installed on the server. We have a perl implementation to unarchive tar files, and can use Compress::Zlib to unarchive .gz files. Unfortunately I'm not aware of one to handle zip files.
Cheers,
Alex
--
Gossamer Threads Inc.
We are trying to keep FileMan pure perl, so we don't want to do anything that requires a system call, or depends on some program installed on the server. We have a perl implementation to unarchive tar files, and can use Compress::Zlib to unarchive .gz files. Unfortunately I'm not aware of one to handle zip files.
Cheers,
Alex
--
Gossamer Threads Inc.