audio-recordings.cgi: file handle var

This commit is contained in:
Milan
2022-07-13 14:11:55 +02:00
parent 902beecd78
commit 563deb0d7f

View File

@@ -378,17 +378,17 @@ sub uploadFile {
print STDERR "tempFile=$tempFile\n"; print STDERR "tempFile=$tempFile\n";
my $start = time(); my $start = time();
open DAT, '>', $tempFile open my $f, '>', $tempFile
or return { error => 'could not save upload. ' . $! . " " . $tempFile }; or return { error => 'could not save upload. ' . $! . " " . $tempFile };
binmode DAT; binmode $f;
my $size = 0; my $size = 0;
my $data = ''; my $data = '';
while ( my $bytesRead = $fh->read( $data, 65000 ) ) { while ( my $bytesRead = $fh->read( $data, 65000 ) ) {
print DAT $data; print $f $data;
$size += $bytesRead; $size += $bytesRead;
$data = ''; $data = '';
} }
close DAT; close $f;
return { return {
dir => $targetDir, dir => $targetDir,