diff --git a/website/agenda/planung/audio-recordings.cgi b/website/agenda/planung/audio-recordings.cgi index d2fed1d..850f1c9 100755 --- a/website/agenda/planung/audio-recordings.cgi +++ b/website/agenda/planung/audio-recordings.cgi @@ -28,8 +28,6 @@ use time(); #$|=1; binmode STDOUT, ":utf8"; -my $useCgi = 0; - our $config = config::get('../config/config.cgi'); our $debug = $config->{system}->{debug}; my $base_dir = $config->{locations}->{base_dir}; @@ -378,17 +376,14 @@ sub uploadFile { print STDERR "tempFile=$tempFile\n"; my $start = time(); - open my $f, '>', $tempFile + open my $out, '>', $tempFile or return { error => 'could not save upload. ' . $! . " " . $tempFile }; - binmode $f; - my $size = 0; - my $data = ''; - while ( my $bytesRead = $fh->read( $data, 65000 ) ) { - print $f $data; - $size += $bytesRead; - $data = ''; - } - close $f; + binmode $out; + my $buffer=''; + print $out $buffer while read( $fh, $buffer, 4096 ); + close $out; + + my $size = (stat($tempFile))[7]; return { dir => $targetDir, diff --git a/website/agenda/planung/js/audio-recordings.js b/website/agenda/planung/js/audio-recordings.js index 72460e6..f925e0d 100644 --- a/website/agenda/planung/js/audio-recordings.js +++ b/website/agenda/planung/js/audio-recordings.js @@ -23,6 +23,7 @@ function changeFile(fileInput){ showError("file is too large. maximum size is 700 MB!"); }else{ $('#uploadButton').show(); + $('#uploadButton').focus(); } } diff --git a/website/agenda/planung/templates/upload-audio-recordings.html b/website/agenda/planung/templates/upload-audio-recordings.html index c63b898..be8758f 100644 --- a/website/agenda/planung/templates/upload-audio-recordings.html +++ b/website/agenda/planung/templates/upload-audio-recordings.html @@ -45,7 +45,7 @@ - +