I want to get the file size. I'm doing it:
my $filename=$query->param("upload_file"); my $filesize = (-s $filename); print "Size: $filesize ";`
But it does not work. Please note that I did not upload the file. I want to check its size before downloading it. Therefore, to limit it to 1 MB.
- . Content-Length, , . , . , Content-Length , , . , .
Content-Length
, , CGI, $ENV{CONTENT_LENGTH}.
$ENV{CONTENT_LENGTH}
, , - ( perldoc CGI):
$CGI::POST_MAX, POST, . CGI.pm POST, , . POST POST, , . , 1 .
$CGI::POST_MAX
, POST, . CGI.pm POST, , . POST POST, , . , 1 .
tmp , .
$.
my $upload_filehandle = $query->upload($field); my $tmpfilename = $query->tmpFileName($upload_filehandle); my $file_size = (-s $tmpfilename);
Perl.
, , Perl.
, , , , .
, .
, , -, . , - , Flash, Flash, , ( ) .
YUI Uploader. : JavaScript/Flash ?
; , $filesize = (-s $filename); , - , Ajax, . , . , , . .
$filesize = (-s $filename);
, , , . , .
perl - X - perldoc.perl.org stat-perldoc.perl.org. , script, , .
Source: https://habr.com/ru/post/1742767/More articles:Drupal: update file system path in database - drupalJQuery Datepicker does not select default date - jqueryCustom HTML output on Zend Form Checkbox setLabel Property - htmlDjango registration and ReCaptcha integration - how to pass user IP address - pythonProblem with C ++ recursion - c ++Enum: get a list of keys - javaHow to enable indexing of pages with dynamic data? - architectureSharepoint: how to get the current site / web list - sharepointdecoding algorithm - algorithmUpdating the application icon in the Windows 7 taskbar - windows-7All Articles