Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing folder as destination while move/copy file destroy folder data #6983

Closed
amrita-shrestha opened this issue Aug 8, 2023 · 4 comments
Labels

Comments

@amrita-shrestha
Copy link
Contributor

Describe the bug

a file(say testfile.txt) is copied over the top of an existing folder(say FOLDER), which overwrites the folder. The folder changes into the file and the name is of the folder(FOLDER)

Question

  • Is It Valid to Specify a Folder as the Destination?

Steps to reproduce

Steps to reproduce the behavior:

  1. create folder New Folder
  2. create file hello.txt and New Folder/example.gif
  3. move file hello.txt to New Folder
curl -XMOVE 'https://localhost:9200/remote.php/dav/spaces/aafeb67a-4a2a-483a-a91f-f475a8a032f2%244c510ada-c86b-4815-8820-42cdf82c3d51/hello.txt' \
-H 'Destination: https://localhost:9200/remote.php/dav/spaces/aafeb67a-4a2a-483a-a91f-f475a8a032f2%244c510ada-c86b-4815-8820-42cdf82c3d51/New%20folder/' \

Expected behavior

Actual behavior

  • status code 204 No content. File renamed into New folder. The existing folder New folder moved to trashbin

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS = 3.1.0-rc.1+712d98e0a2

Additional context

Add any other context about the problem here.

@saw-jan
Copy link
Member

saw-jan commented Sep 7, 2023

status code 204 No content. File renamed into New folder. The existing folder New folder moved to trashbin

This should be the expected behavior, right?
CC @2403905 @ScharfViktor

@2403905
Copy link
Contributor

2403905 commented Sep 26, 2023

@kobergj @butonic We have a bunch of similar issues where the source is a file and the destination is a folder when copying/moving via the API.
What is an expected behavior should be here?
There are only examples in a webdav spec where the resource and destination have the same type (collection or non-collection)
http://www.webdav.org/specs/rfc4918.html#n-copy-for-non-collection-resources

@2403905
Copy link
Contributor

2403905 commented Sep 28, 2023

status code 204 No content. File renamed into New folder. The existing folder New folder moved to trashbin

This should be the expected behavior, right? CC @2403905 @ScharfViktor

This is an expected behavior

Scenario Outline: copy a file over the top of an existing folder

@saw-jan
Copy link
Member

saw-jan commented Sep 28, 2023

@2403905 Please, you may close the issue if the behavior is expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants