Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
02c0fe8d
Commit
02c0fe8d
authored
Mar 23, 2015
by
Lukas Reschke
Browse files
Merge pull request #13941 from owncloud/fix-folder-upload-on-firefox
Show message if upload of folder isn't allowed
parents
0adcb991
4e18b525
Changes
1
Hide whitespace changes
Inline
Side-by-side
apps/files/js/file-upload.js
View file @
02c0fe8d
...
...
@@ -266,11 +266,20 @@ OC.Upload = {
// in case folder drag and drop is not supported file will point to a directory
// http://stackoverflow.com/a/20448357
if
(
!
file
.
type
&&
file
.
size
%
4096
===
0
&&
file
.
size
<=
102400
)
{
var
dirUploadFailure
=
false
;
try
{
var
reader
=
new
FileReader
();
reader
.
readAsBinaryString
(
file
);
}
catch
(
NS_ERROR_FILE_ACCESS_DENIED
)
{
//file is a directory
dirUploadFailure
=
true
;
}
if
(
file
.
size
===
0
)
{
// file is empty or a directory
dirUploadFailure
=
true
;
}
if
(
dirUploadFailure
)
{
data
.
textStatus
=
'
dirorzero
'
;
data
.
errorThrown
=
t
(
'
files
'
,
'
Unable to upload {filename} as it is a directory or has 0 bytes
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment