server icon indicating copy to clipboard operation
server copied to clipboard

Allow uploading folders on file-drop ("upload only") shares

Open tjohs opened this issue 7 years ago • 56 comments

Goal:

  • Allow uploading folders on file drop shares with preserving their folder structure.

Technical goal:

  • Allow MKCOL for public shares with only CREATE permissions and allow (only!) the current uploader to upload into that folder.

Problems:

  • We must not leak information to that uploader that a similar named folder already existed when creating the folder (silently rename it on server side)
  • We must ensure the uploader can only upload in folders created by them

Original report

Steps to reproduce

  1. create a folder with content on local drive (e.g. \folder\text.txt, \folder\folder\text.txt)
  2. create folder in NextCloud to share
  3. share folder externally (i.e. email address)
  4. adjust permission to "Upload Only"
  5. open link in browser
  6. drag&drop folder (step 0) into the browser window
  7. files are uploaded (text.txt, text (2).txt)

Expected behaviour

Within the "shared folder" the dragged folder should be created, keeping the folder/files structure.

Actual behaviour

No folder is created. Only the contained files are uploaded. Files within different subfolders will be uploaded into the same "shared folder", folder hierarchy is not kept, files (from subfolders) that are already existing in the "shared folder" will be renamed "filename (2)"... This can lead to useless uploads: assuming system backups of similar but not identical systems. They share same configuration file names but different content. If now the hierarchy is flattened while \System1\Conf\config.ini and \System2\Conf\config.ini are uploaded, the "shared folder" will contain "config.ini" and "config (2).ini", but you would not know which file belongs to which system backup... This is only one of an endless variation of scenarios.

Server configuration

Operating system: ~Debian 9~ Ubuntu 22.04.4 LTS Web server: Apache 2 Database: mysql (mariaDB 11.4.2) PHP version: ~7.2.19~ 8.2.19 Nextcloud version: ~16.0.1~ 29.0.2 Where did you install Nextcloud from: ~nextcloudpi~ hub.docker.com Are you using encryption: no

Client configuration

Browser: Firefox ~67.0.1~ 126.0.1 (also tested on Microsoft Edge with similar result) Operating system: ~Windows 10 / Windows 7~ Windows 11

Conclusion

The option to share folders with colleagues/customers to simply upload files/folders is nice, but the described behaviour leads to useless data. An alternative to creating folders as I would have expected would be to automatically create ZIPs upon uploading named as the folder(s)

EDIT: Still the same with NC24.0.6 EDIT: Still the same with NC27.1.7 EDIT: Still the same with NC28.0.3 EDIT: Still the same with NC28.0.6 (Nextcloud Hub 7) EDIT: Still the same with NC29.0.~1~2 (Nextcloud Hub 8)

When will this bug be finally fixed?! This is a major flaw limiting the use of shared folders!

tjohs avatar Jun 11 '19 13:06 tjohs

+1 , normal users do not understand why this is not working as expected. They say: "It just works on webservice XY"

stleitner avatar Aug 02 '19 11:08 stleitner

There is even more weird things going on when uploading a folder with sub-folders in chrome: the sub-folder appears in nextcloud as a zip file if there are conflicting names!

:confused:

despens avatar Aug 12 '19 07:08 despens

+1 , normal users do not understand why this is not working as expected. They say: "It just works on webservice XY"

:-) I think it does not only surprise "normal users", but also those running their own servers and thus having more technical background...

tjohs avatar Aug 12 '19 07:08 tjohs

Any update on this? This was an issue for us as well, and I don't understand why this is the case since normal upload (so either on your own account or in a shared folder with "Allow upload and editing") allows uploading a folder structure. It should therefore be an easy fix, right?

stefandesu avatar Jan 13 '21 12:01 stefandesu

Unfortunately not. Since this issue remains now since several versions of NC, I have sort of given up - although this is a really annoying problem and I cannot understand why this is not considered being a problem ... I agree, it feels like there should be a really easy fix.

I do not know where / how to get this noticed and actually worked on... So if anyone can assist with this, would be welcome!

tjohs avatar Jan 13 '21 13:01 tjohs

cc @nextcloud/sharing does it make sense keeping the folder/files structure. for upload only folders?

szaimen avatar Jun 22 '21 10:06 szaimen

@szaimen On the most basic level, if a user uploads a folder structure with two files that have the same name but are located in different folders, flattening the structure is causing data loss. (Apart from the fact that flattening file structure itself is data loss.)

despens avatar Jun 22 '21 11:06 despens

cc @nextcloud/sharing does it make sense keeping the folder/files structure. for upload only folders?

As @despens commented, it is essential to keep the folder structure not to confuse with the contained files being automatically renamed. One cannot check from which subfolder the files originated from. This is an absolute no-go!

Actually I wonder how this can be considered not to be worth solving...

tjohs avatar Jun 22 '21 15:06 tjohs

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

ghost avatar Jul 22 '21 16:07 ghost

as now already a bot consideres this topic to be marked "stale", I wonder how it is possible to raise the awareness of the developers for this issue? I consider this a real issue that must be solved!

tjohs avatar Jul 23 '21 08:07 tjohs

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

ghost avatar Aug 22 '21 08:08 ghost

Leaving a message here to revive this issue, since also I would very much like to see it resolved

holfreij avatar Feb 08 '22 15:02 holfreij

Hope this resolved soon i also need this and didn't find it when i needed it the most.

Karem-sobhy avatar Aug 19 '22 00:08 Karem-sobhy

unfortunately this issue and bug report does not seem to be seen... If anyone has an idea how to get this issue to be realized as problematic, please comment!

tjohs avatar Aug 20 '22 21:08 tjohs

same for me, I think it's a big problem not to keep the hierarchical directory structure. When you work in education and you ask for group work where each group turns in multiple documents, it's really unusable as it is.

julpec avatar Jan 09 '23 23:01 julpec

I fully agree. For me this is a major issue and I am surprised that this is not being solved since 2.5 years now. I have identified the issue with NC16 already and it is still present in NC24.0.6 Does anyone know, how the developpers can be pointed towards this issue? I had hoped that opening an issue here would be the right place, but obviously this is not the case

tjohs avatar Jan 10 '23 09:01 tjohs

@tjohs Perhaps you can write a post on their forum?

holfreij avatar Jan 10 '23 09:01 holfreij

Had done this already... (actually this issue here was based on the suggestion of @JimmyKater )

https://help.nextcloud.com/t/files-drop-uploading-folders/54080/4

tjohs avatar Jan 10 '23 09:01 tjohs

Coming here to let everyone know that uploading folders to a shared file drop directory still does not work in nextcloud 26.0.3. This is really weird, why even use different uploading mechanisms for logged-in and not logged-in users?

despens avatar Jul 20 '23 13:07 despens

This is extremely annoying. Does anyone have an idea, how we finally can have this issue being seen by developers - and hopefully solved in the end?

tjohs avatar Jul 20 '23 15:07 tjohs