audio-recodings: simpler upload
This commit is contained in:
@@ -28,8 +28,6 @@ use time();
|
|||||||
#$|=1;
|
#$|=1;
|
||||||
binmode STDOUT, ":utf8";
|
binmode STDOUT, ":utf8";
|
||||||
|
|
||||||
my $useCgi = 0;
|
|
||||||
|
|
||||||
our $config = config::get('../config/config.cgi');
|
our $config = config::get('../config/config.cgi');
|
||||||
our $debug = $config->{system}->{debug};
|
our $debug = $config->{system}->{debug};
|
||||||
my $base_dir = $config->{locations}->{base_dir};
|
my $base_dir = $config->{locations}->{base_dir};
|
||||||
@@ -378,17 +376,14 @@ sub uploadFile {
|
|||||||
print STDERR "tempFile=$tempFile\n";
|
print STDERR "tempFile=$tempFile\n";
|
||||||
|
|
||||||
my $start = time();
|
my $start = time();
|
||||||
open my $f, '>', $tempFile
|
open my $out, '>', $tempFile
|
||||||
or return { error => 'could not save upload. ' . $! . " " . $tempFile };
|
or return { error => 'could not save upload. ' . $! . " " . $tempFile };
|
||||||
binmode $f;
|
binmode $out;
|
||||||
my $size = 0;
|
my $buffer='';
|
||||||
my $data = '';
|
print $out $buffer while read( $fh, $buffer, 4096 );
|
||||||
while ( my $bytesRead = $fh->read( $data, 65000 ) ) {
|
close $out;
|
||||||
print $f $data;
|
|
||||||
$size += $bytesRead;
|
my $size = (stat($tempFile))[7];
|
||||||
$data = '';
|
|
||||||
}
|
|
||||||
close $f;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dir => $targetDir,
|
dir => $targetDir,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ function changeFile(fileInput){
|
|||||||
showError("file is too large. maximum size is 700 MB!");
|
showError("file is too large. maximum size is 700 MB!");
|
||||||
}else{
|
}else{
|
||||||
$('#uploadButton').show();
|
$('#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;" id="uploadSize"></td>
|
||||||
|
|
||||||
<td colspan="2" style="text-align:right;padding-right:0.5em;" >
|
<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>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user