This commit is contained in:
Frank Karlitschek 2012-09-16 17:14:04 +02:00
commit f17555285e
2 changed files with 5 additions and 3 deletions

View File

@ -67,7 +67,7 @@ if($source) {
$result=OC_Filesystem::file_put_contents($target, $sourceStream);
if($result) {
$mime=OC_Filesystem::getMimetype($target);
$eventSource->send('success', $mime);
$eventSource->send('success', array('mime'=>$mime, 'size'=>OC_Filesystem::filesize($target)));
} else {
$eventSource->send('error', "Error while downloading ".$source. ' to '.$target);
}

View File

@ -556,10 +556,12 @@ $(document).ready(function() {
eventSource.listen('progress',function(progress){
$('#uploadprogressbar').progressbar('value',progress);
});
eventSource.listen('success',function(mime){
eventSource.listen('success',function(data){
var mime=data.mime;
var size=data.size;
$('#uploadprogressbar').fadeOut();
var date=new Date();
FileList.addFile(localName,0,date,false,hidden);
FileList.addFile(localName,size,date,false,hidden);
var tr=$('tr').filterAttr('data-file',localName);
tr.data('mime',mime);
getMimeIcon(mime,function(path){