In cases folder drag and drop is not supported a proper message is displayed
This commit is contained in:
parent
2fc9e27ced
commit
e8be2ac554
|
@ -242,12 +242,19 @@ OC.Upload = {
|
|||
data.errorThrown = errorMessage;
|
||||
}
|
||||
|
||||
if (file.type === '' && file.size === 4096) {
|
||||
// in case folder drag and drop is not supported file will point to a directory
|
||||
if (!file.type && file.size%4096 === 0 && file.size <= 102400) {
|
||||
try {
|
||||
reader = new FileReader();
|
||||
reader.readAsBinaryString(f);
|
||||
} catch (NS_ERROR_FILE_ACCESS_DENIED) {
|
||||
//file is a directory
|
||||
data.textStatus = 'dirorzero';
|
||||
data.errorThrown = t('files', 'Unable to upload {filename} as it is a directory or has 0 bytes',
|
||||
{filename: file.name}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// add size
|
||||
selection.totalBytes += file.size;
|
||||
|
|
Loading…
Reference in New Issue