in reply to how to get the sizes of a file when i use CGI.PM to upload it~~?
Hope this helps :)#!/usr/bin/perl -w use strict; use Net::FTP; my ($server, $user, $pass, $file); my $ftph; my @files; my @list; $server = 'wookie.mcom.com'; $user = 'ukgaryc'; $pass = 'Radio105'; $ftph=Net::FTP->new($server)||die("No connection\n"); $ftph->login($user,$pass)||die("Can't login\n"); @files = $ftph->ls; foreach $file (@files) { my $size; $size = $ftph->size($file); $size ? print "$file is $size bytes\n" : print "Cannot get size of + file $file\n"; } $ftph->quit||die("Failed to disconnect\n"); exit(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: how to get the sizes of a file when i use CGI.PM to upload it~~?
by Beatnik (Parson) on Jul 30, 2001 at 16:17 UTC |