Drag-N-Drop not working - "You don’t have permission to upload or create files here"

Hi;

Uusing Ubuntu LTS 16.04.1, Apache version 2.4.18, MySQL version 5.7.26, PHP 7.0.33-0ubuntu0.16.04.5

After upgrading from earlier versions to 15.0.9 got a strange problem - whenever i try to upload a single file via Drag-N-Drop over the Browser (Firefox/Chrome) i got the error message “You don’t have permission to upload or create files here”.

When i use “upload file” from the menu it works as always…
My data directory user and group is “www-data”, new folder are 0755 and the files got 0644…

What could that be? What are the differences between using drag-n-drop compared to uploading via the menu?

Any ideas?
thanks!

1 Like

Hello, Had the exactly same issue on the new updated **Nextcloud version 16.0.2, found this on the Web, works for me:

From 51683fa9d1c44e1ce273d87acf6eaddf73b83bcf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= jus@bitgrid.net
Date: Tue, 18 Jun 2019 12:34:04 +0200
Subject: [PATCH] Properly load permissions in showActions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When setViewerMode(false) is called, the permissions should be fetched from the available dirInfo

Signed-off-by: Julius Härtl jus@bitgrid.net

apps/files/js/filelist.js | 2 ±
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 753b546b69d…bfaee261b11 100644
— a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1803,7 +1803,7 @@
* @return permission value as integer
*/
getDirectoryPermissions: function() {

  •   	return parseInt(this.$el.find('#permissions').val(), 10);
    
  •   	return this && this.dirInfo && this.dirInfo.permissions ? this.dirInfo.permissions : parseInt(this.$el.find('#permissions').val(), 10);
      },
      /**
       * Changes the current directory and reload the file list.
1 Like

Thank you, specialpierson;

this tipp helped…
btw - i am wondering that no one of nextxloud itself is around since days - did they all fell into a coma the same day ? :wink:

The same as with the missing 14.0.13 files…

So is this a bug or what? I have the same issue, I can upload files via menu but drag and drop causes permission errors as above. This just started with 16.0.2

My folder permissions are fine, in fact they have had the same permissions for years and it worked fine up until 16.0.2 Given that I can upload via menus, this probably has nothing to do with folder permissions.

The recommended change in filelist.js did fix the issue

could you post either the change required, or the fixed version? after updating to 16.0.2 i can’t upload in folders i created, and OP’s code format is hard to read (not properly wrapped)

edit nevermind got the patch to work.

You have to edit the file apps/files/js/filelist.js

change the line 1695

from

return parseInt(this.$el.find('#permissions').val(), 10);

to

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

This helps - and yes - it seems to be a bug…

3 Likes

Thx this fixed it for me!

that fix didnt worked for me at all… any other tipps?

Strange - which version of NC do you use? Did you restart your webserver?
Yesterday Nextcoud also came out with new versions…

Seems somebody listened to this thread… in 15.0.10 the proposed patch is included, and D&D works as before.

Yes - thats right - yesterday i took a look on the 15.0.10 and found exact the patch from above…:wink:

I’m having a similar issue, but in my case, drag and drop does literally nothing. No error, nothing. I checked the file here, and it does have:

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

but it’s line 1905, and I am using the snap install so I cannot edit it anyway.