Filename from header not recognized when disposition type is missing
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 59.9k
- Forks
- 5.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 48
Description
The associated forum post URL from https://forum.rclone.org
none
What is the problem you are having with rclone?
Filenames surrounded by quotes in the Content-Disposition header are not recognized,
When the Content-Disposition header is missing the disposition type, such as attachment or inline, the filename is not recognized by the mime package.
Both curl -OJ and wget --content-disposition grabs the filename from headers without a disposition type. Perhaps rclone could just be smart about it too, even though it may or may not go against spec?
/data # curl -I 'http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4'
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Disposition: filename="Sintel.mp4"
Content-Length: 129241752
Content-Type: video/mp4
Date: Sun, 07 Dec 2025 21:45:06 GMT
and rclone doesn't seem to handle them either
What is your rclone version (output from rclone version)
/data # rclone --version
rclone v1.71.0
- os/version: alpine 3.22.1 (64 bit)
- os/kernel: 6.1.0-34-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.1
- go/linking: static
- go/tags: none
/data # ./rclone-v1.72.0-linux-amd64/rclone --version
rclone v1.72.0
- os/version: alpine 3.22.1 (64 bit)
- os/kernel: 6.1.0-34-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.4
- go/linking: static
- go/tags: none
/data # ./rclone-v1.73.0-beta.9336.847734d42-linux-amd64/rclone --version
rclone v1.73.0-beta.9336.847734d42
- os/version: alpine 3.22.1 (64 bit)
- os/kernel: 6.1.0-34-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.25.5
- go/linking: static
- go/tags: none
Which OS you are using and how many bits (e.g. Windows 7, 64 bit)
Alpine 3.22.1, 64 bit, the rclone docker image
Which cloud storage system are you using? (e.g. Google Drive)
unrelated
The command you were trying to run (e.g. rclone copy /tmp remote:tmp)
rclone -vv copyurl -a --header-filename 'http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4' --webdav-url http://172.20.0.6:9898 :webdav:/test
./rclone-v1.72.0-linux-amd64/rclone -vv copyurl -a --header-filename 'http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4' --webdav-url http://172.20.0.6:9898 :webdav:/test
./rclone-v1.73.0-beta.9336.847734d42-linux-amd64/rclone -vv copyurl -a --header-filename 'http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4' --webdav-url http://172.20.0.6:9898 :webdav:/test
A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)
/data # rclone -vv copyurl -a --header-filename 'http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4' --webdav-url http://172.20.0.6:9898 :webdav:/test
2025/12/07 21:43:57 DEBUG : rclone: Version "v1.71.0" starting with parameters ["rclone" "-vv" "copyurl" "-a" "--header-filename" "http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4" "--webdav-url" "http://172.20.0.6:9898" ":webdav:/test"]
2025/12/07 21:43:57 DEBUG : Creating backend with remote ":webdav:/test"
2025/12/07 21:43:57 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2025/12/07 21:43:57 DEBUG : :webdav: detected overridden config - adding "{iNuAj}" suffix to name
2025/12/07 21:43:57 DEBUG : found headers:
2025/12/07 21:43:57 DEBUG : fs cache: renaming cache item ":webdav:/test" to be canonical ":webdav{iNuAj}:test"
2025/12/07 21:43:57 ERROR : Attempt 1/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 21:43:57 DEBUG : fs cache: switching user supplied name ":webdav:/test" for canonical name ":webdav{iNuAj}:test"
2025/12/07 21:43:57 ERROR : Attempt 2/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 21:43:57 DEBUG : fs cache: switching user supplied name ":webdav:/test" for canonical name ":webdav{iNuAj}:test"
2025/12/07 21:43:57 ERROR : Attempt 3/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 21:43:57 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s
2025/12/07 21:43:57 DEBUG : 6 go routines active
2025/12/07 21:43:57 NOTICE: Failed to copyurl: CopyURL failed: filename not found in the Content-Disposition header
/data # ./rclone-v1.72.0-linux-amd64/rclone -vv copyurl -a --header-filename 'http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4' --webdav-url http://172.20.0.6:9898 :webdav:/test
2025/12/07 21:44:22 DEBUG : rclone: Version "v1.72.0" starting with parameters ["./rclone-v1.72.0-linux-amd64/rclone" "-vv" "copyurl" "-a" "--header-filename" "http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4" "--webdav-url" "http://172.20.0.6:9898" ":webdav:/test"]
2025/12/07 21:44:22 DEBUG : Creating backend with remote ":webdav:/test"
2025/12/07 21:44:22 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2025/12/07 21:44:22 DEBUG : :webdav: detected overridden config - adding "{iNuAj}" suffix to name
2025/12/07 21:44:22 DEBUG : found headers:
2025/12/07 21:44:22 DEBUG : fs cache: renaming cache item ":webdav:/test" to be canonical ":webdav{iNuAj}:test"
2025/12/07 21:44:22 ERROR : Attempt 1/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 21:44:22 DEBUG : fs cache: switching user supplied name ":webdav:/test" for canonical name ":webdav{iNuAj}:test"
2025/12/07 21:44:22 ERROR : Attempt 2/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 21:44:22 DEBUG : fs cache: switching user supplied name ":webdav:/test" for canonical name ":webdav{iNuAj}:test"
2025/12/07 21:44:22 ERROR : Attempt 3/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 21:44:22 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s
2025/12/07 21:44:22 DEBUG : 7 go routines active
2025/12/07 21:44:22 NOTICE: Failed to copyurl: CopyURL failed: filename not found in the Content-Disposition header
/data # ./rclone-v1.73.0-beta.9336.847734d42-linux-amd64/rclone -vv copyurl -a --header-filename 'http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4' --webdav-url http://172.20.0.6:9898 :webdav:/test
2025/12/07 22:29:43 DEBUG : rclone: Version "v1.73.0-beta.9336.847734d42" starting with parameters ["./rclone-v1.73.0-beta.9336.847734d42-linux-amd64/rclone" "-vv" "copyurl" "-a" "--header-filename" "http://172.20.0.14:8080/data?ih=08ada5a7a6183aae1e09d831df6748d566095a10&path=Sintel.mp4" "--webdav-url" "http://172.20.0.6:9898" ":webdav:/test"]
2025/12/07 22:29:43 DEBUG : Creating backend with remote ":webdav:/test"
2025/12/07 22:29:43 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2025/12/07 22:29:43 DEBUG : :webdav: detected overridden config - adding "{iNuAj}" suffix to name
2025/12/07 22:29:43 DEBUG : found headers:
2025/12/07 22:29:45 DEBUG : fs cache: renaming cache item ":webdav:/test" to be canonical ":webdav{iNuAj}:test"
2025/12/07 22:29:45 ERROR : Attempt 1/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 22:29:45 DEBUG : fs cache: switching user supplied name ":webdav:/test" for canonical name ":webdav{iNuAj}:test"
2025/12/07 22:29:45 ERROR : Attempt 2/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 22:29:45 DEBUG : fs cache: switching user supplied name ":webdav:/test" for canonical name ":webdav{iNuAj}:test"
2025/12/07 22:29:45 ERROR : Attempt 3/3 failed with 1 errors and: CopyURL failed: filename not found in the Content-Disposition header
2025/12/07 22:29:45 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.0s
2025/12/07 22:29:45 DEBUG : 6 go routines active
2025/12/07 22:29:45 NOTICE: Failed to copyurl: CopyURL failed: filename not found in the Content-Disposition header
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at fs/operations/operations.go around lines 1862-1878 and reproduce the reported copyurl command with the Content-Disposition: filename="Sintel.mp4" header. Confirm the filename is recognized when the disposition type is omitted, and verify the copyurl operation completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100