At the download of a file: does it make sense to check the filesize?
- by sid_com
Does the test of the file-size make sense here? I tried to cut the connection while downloading, but it looks like the size-test is never reached.
#!/usr/bin/env perl
use warnings;
use strict;
use 5.012;
use LWP::Simple;
my $file_size = '2342';
my $response = getstore( 'url', 'filename' );
if ( is_success $response ) {
if ( $file_size == -s 'filename' ) {
say "OK";
}
}