How can I get file size in Perl before processing upload request?
        Posted  
        
            by zeina
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by zeina
        
        
        
        Published on 2010-04-26T07:59:07Z
        Indexed on 
            2010/04/26
            11:13 UTC
        
        
        Read the original article
        Hit count: 245
        
I want to get file size I'm doing this:
my $filename=$query->param("upload_file");
my $filesize = (-s $filename);
print "Size: $filesize ";`
Yet it is not working. Note that I did not upload the file. I want to check its size before uploading it. So to limit it to max of 1 MB.
© Stack Overflow or respective owner