diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index 4619315ce0..495c821216 100644 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -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); } diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 101e2bad2e..30c9b84843 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -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){