owncloud / owncloud/ocis

COPY file/folder to same name is possible (but 500 code error for folder with spaces path)

Open
#8,711 1 comment 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

### Step to Reproduce
1. Create this folder tree:
- `parent/child/lorem.txt`
2. COPY `parent/child/lorem.txt` to `parent/child/lorem.txt`
```bash
curl -XCOPY "https://localhost:9200/remote.php/spaces//parent/child/lorem.txt" \
-H"Destination: https://localhost:9200/remote.php/spaces//parent/child/lorem.txt" \
-uadmin:admin -vk
```
4. COPY `parent/child` to `parent/child`
```bash
curl -XCOPY "https://localhost:9200/remote.php/spaces//parent/child" \
-H"Destination: https://localhost:9200/remote.php/spaces//parent/child" \
-uadmin:admin -vk
```

### FIndings
1. COPY to same file:
```
/webdav - 204 (file content exists)
/dav/files - 204 (file content exists)
/dav/spaces - 204 (file content exists)
```
2. COPY to same folder:
```
/webdav - 204 (folder exists but folder content is moved to trashbin - ❓)
/dav/files - 204 (folder exists but folder content is moved to trashbin - ❓)
/dav/spaces - 500 (not possible in dav/spaces path)
```
NOTE: With `Overwrite: F header`, all requests return `412 Precondition Failed`

### Queries
1. What is the actual behavior? Is it possible COPY to same path ?
2. Should copying folder into same path result in creating new folder while sending that folder to trashbin?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.