mirror of
https://github.com/rclone/rclone.git
synced 2025-02-23 05:51:36 +01:00
yandex: pass options to rest.Opts for upload
This commit is contained in:
parent
011ca244b2
commit
51b617f601
@ -1065,7 +1065,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
|
|||||||
return resp.Body, err
|
return resp.Body, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeType string) (err error) {
|
func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeType string, options ...fs.OpenOption) (err error) {
|
||||||
// prepare upload
|
// prepare upload
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
var ur api.AsyncInfo
|
var ur api.AsyncInfo
|
||||||
@ -1073,6 +1073,7 @@ func (o *Object) upload(ctx context.Context, in io.Reader, overwrite bool, mimeT
|
|||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: "/resources/upload",
|
Path: "/resources/upload",
|
||||||
Parameters: url.Values{},
|
Parameters: url.Values{},
|
||||||
|
Options: options,
|
||||||
}
|
}
|
||||||
|
|
||||||
opts.Parameters.Set("path", o.fs.opt.Enc.FromStandardPath(o.filePath()))
|
opts.Parameters.Set("path", o.fs.opt.Enc.FromStandardPath(o.filePath()))
|
||||||
@ -1121,7 +1122,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
|||||||
}
|
}
|
||||||
|
|
||||||
//upload file
|
//upload file
|
||||||
err = o.upload(ctx, in1, true, fs.MimeType(ctx, src))
|
err = o.upload(ctx, in1, true, fs.MimeType(ctx, src), options...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user