audio-recodings: simpler upload
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -23,6 +23,7 @@ function changeFile(fileInput){
|
||||
showError("file is too large. maximum size is 700 MB!");
|
||||
}else{
|
||||
$('#uploadButton').show();
|
||||
$('#uploadButton').focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<td colspan="2" style="text-align:right;padding-right:0.5em;" id="uploadSize"></td>
|
||||
|
||||
<td colspan="2" style="text-align:right;padding-right:0.5em;" >
|
||||
<button id="uploadButton" name="action" value="upload" >upload</button>
|
||||
<button id="uploadButton" name="action" value="upload" tabindex="0">upload</button>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user