After updating to NC16.0.2, I can not upload via Web UI by D&D

Nextcloud version (eg, 12.0.2): 16.0.2
Operating system and version (eg, Ubuntu 17.04): CentOS 7.6
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.14.2
PHP version (eg, 7.1): 7.3.6

The issue you are facing:
Log in with a PC web browser and try uploading to NC by drag and drop.
Then, the error “You don’t have permission to upload or create files here” is displayed and fails.
There was no problem with NC 16.0.1. It occurred at NC 16.0.2.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Login to NC (any user)
  2. Upload files to the web browser by drag and drop.

The output of your Nextcloud log in Admin > Logging:

There are no errors recorded.
  • This is happening with every PC I own. Web browser tried with Edge, Firefox, Chrome, Vivaldi, Brave, Sleipnir.
  • This happens whether the user is a regular user or an admin user.
  • There is no problem with uploading from “Upload File” in the file’s plus icon (menu).
  • There is no problem with uploading from a smartphone. I can’t drag and drop my smartphone …
  • There is no problem with uploading via WebDAV.
  • There is no problem in editing existing text files etc. on NC and saving them.

I ran maintenance: repair with occ command and reset the permission under Nextcloud directory.

Is there any other way to enable drag and drop operation?

1 Like

Hi,

This is a bug, which was identified directly after the release of 16.0.2. Luckily there is a fix available already as well.

Bug report:

Fix:

  • change directory to your Nextcloud installation directory (for example /var/www/nextcloud)
  • edit the file apps/files/js/filelist.js and change return value in line 1808 (on NC16.0.2) as follows

from

                getDirectoryPermissions: function() {
                        return parseInt(this.$el.find('#permissions').val(), 10);
                },

to

                getDirectoryPermissions: function() {
                        return this && this.dirInfo && this.dirInfo.permissions ? this.dirInfo.permissions : parseInt(this.$el.find('#permissions').val(), 10);
                },

Source: https://github.com/nextcloud/server/pull/16282/files


The fix for NC15 stable is the same, but in line 1695: https://github.com/nextcloud/server/pull/16283

This issue should be fixed in the next release.

2 Likes

Thank you!
I was able to edit the source and solve it.

Just a quick update here: NC 16.0.3 has been released in the meantime and this release fixes this issue.

1 Like