fix blocking drag & drop upload of folders

This commit is contained in:
Robin Appelman 2012-10-12 15:30:16 +02:00
parent c099545b6d
commit 5b2f3c7f72
1 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ $(document).ready(function() {
var totalSize=0;
if(files){
for(var i=0;i<files.length;i++){
if(files[i].size ==0 && files[i].type== '')
if(files[i].size ==0 || files[i].type== '')
{
OC.dialogs.alert(t('files', 'Unable to upload your file as it is a directory or has 0 bytes'), t('files', 'Upload Error'));
return;
@ -282,7 +282,7 @@ $(document).ready(function() {
var fileName = files[i].name
var dropTarget = $(e.originalEvent.target).closest('tr');
if(dropTarget && dropTarget.attr('data-type') === 'dir') { // drag&drop upload to folder
var dirName = dropTarget.attr('data-file')
var dirName = dropTarget.attr('data-file');
var jqXHR = $('.file_upload_start').fileupload('send', {files: files[i],
formData: function(form) {
var formArray = form.serializeArray();