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

WebDAV: Indicate final file size when doing chunk upload #7810

Open
sntran opened this issue Apr 28, 2024 · 0 comments
Open

WebDAV: Indicate final file size when doing chunk upload #7810

sntran opened this issue Apr 28, 2024 · 0 comments

Comments

@sntran
Copy link
Contributor

sntran commented Apr 28, 2024

What is your current rclone version (output from rclone version)?

rclone v1.65.1

  • os/version: darwin 14.4.1 (64 bit)
  • os/kernel: 23.4.0 (x86_64)
  • os/type: darwin
  • os/arch: amd64
  • go/version: go1.21.5
  • go/linking: dynamic
  • go/tags: cmount

What problem are you are trying to solve?

Currently, when setting vendor to "nextcloud", rclone will MKCOL a temporary folder using the MD5 hash of the file path, prefixed with "rclone-chunked-upload-". While this works fine for Nextcloud, other implementations may not be able to take advantage of the chunking feature when the original file size is not know.

My use case is to be able to use rclone against storage systems that support chunked upload through API, but not WebDAV. That can be possible by writing a proxy on top of the API. However, some API requires knowing the file size beforehand before accepting chunks.

Example usage:

$ rclone copy \
  --webdav-vendor=nextcloud \
  --webdav-url=http://localhost:8000/dav/files/fixtures \
  fixtures/ :webdav: 

How do you think rclone should be changed to solve that?

Include the file size somewhere. One way is to use "Content-Range" header like Google Cloud Storage (https://cloud.google.com/storage/docs/performing-resumable-uploads#chunked-upload). However, that does not help when file size is needed in advance of the PUT.

Alternatively, we can append it to the name of the temporary upload folder, i.e. rclone-chunked-upload-:md5-:size. This way uploading to NextCloud still works normally.

Or we can do both.

I don't think it's a big change, and it's not breaking anything. I'd be happy to submit a PR if it's acceptable.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants