fix(webdav): sharepoint upload

This commit is contained in:
Xhofe
2022-04-24 15:38:17 +08:00
parent e4df146043
commit 42c0e438d5
4 changed files with 14 additions and 9 deletions

View File

@ -396,7 +396,7 @@ func (c *Client) ReadStreamRange(path string, offset, length int64) (io.ReadClos
// Write writes data to a given path
func (c *Client) Write(path string, data []byte, _ os.FileMode) (err error) {
s, err := c.put(path, bytes.NewReader(data))
s, err := c.put(path, bytes.NewReader(data), nil)
if err != nil {
return
}
@ -412,7 +412,7 @@ func (c *Client) Write(path string, data []byte, _ os.FileMode) (err error) {
return
}
s, err = c.put(path, bytes.NewReader(data))
s, err = c.put(path, bytes.NewReader(data), nil)
if err != nil {
return
}
@ -425,14 +425,14 @@ func (c *Client) Write(path string, data []byte, _ os.FileMode) (err error) {
}
// WriteStream writes a stream
func (c *Client) WriteStream(path string, stream io.Reader, _ os.FileMode) (err error) {
func (c *Client) WriteStream(path string, stream io.Reader, _ os.FileMode, callback func(r *http.Request)) (err error) {
err = c.createParentCollection(path)
if err != nil {
return err
}
s, err := c.put(path, stream)
s, err := c.put(path, stream, callback)
if err != nil {
return err
}