go-webdav icon indicating copy to clipboard operation
go-webdav copied to clipboard

webdav: add size to FileSystem.Create()

Open DeepDiver1975 opened this issue 1 year ago • 1 comments
trafficstars

In some cases the total size is necessary upfront to perform the upload to an external system.

And even if not it is good to have it as a minimal test to see if data was transmitted completely ....

Open question: how to address other valuable headers like checksums or what ever ....

maybe we pass the full request object to Create()? Or body + headers?

@emersion any objections/idea?

DeepDiver1975 avatar Apr 09 '24 13:04 DeepDiver1975

Hm right… I think the use-case is reasonable, but backends should keep in mind that the size is just a hint, it may be unset (-1). Also, HTTP compression (Content-Encoding) will always leave Content-Length unset.

emersion avatar Apr 11 '24 13:04 emersion