forked from TrueCloudLab/rclone
box: pass options to rest.Opts for upload
This commit is contained in:
parent
38123c70eb
commit
0b0163dde2
1 changed files with 3 additions and 2 deletions
|
@ -1191,7 +1191,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
|
||||||
// upload does a single non-multipart upload
|
// upload does a single non-multipart upload
|
||||||
//
|
//
|
||||||
// This is recommended for less than 50 MB of content
|
// This is recommended for less than 50 MB of content
|
||||||
func (o *Object) upload(ctx context.Context, in io.Reader, leaf, directoryID string, modTime time.Time) (err error) {
|
func (o *Object) upload(ctx context.Context, in io.Reader, leaf, directoryID string, modTime time.Time, options ...fs.OpenOption) (err error) {
|
||||||
upload := api.UploadFile{
|
upload := api.UploadFile{
|
||||||
Name: o.fs.opt.Enc.FromStandardName(leaf),
|
Name: o.fs.opt.Enc.FromStandardName(leaf),
|
||||||
ContentModifiedAt: api.Time(modTime),
|
ContentModifiedAt: api.Time(modTime),
|
||||||
|
@ -1210,6 +1210,7 @@ func (o *Object) upload(ctx context.Context, in io.Reader, leaf, directoryID str
|
||||||
MultipartContentName: "contents",
|
MultipartContentName: "contents",
|
||||||
MultipartFileName: upload.Name,
|
MultipartFileName: upload.Name,
|
||||||
RootURL: uploadURL,
|
RootURL: uploadURL,
|
||||||
|
Options: options,
|
||||||
}
|
}
|
||||||
// If object has an ID then it is existing so create a new version
|
// If object has an ID then it is existing so create a new version
|
||||||
if o.id != "" {
|
if o.id != "" {
|
||||||
|
@ -1251,7 +1252,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
||||||
|
|
||||||
// Upload with simple or multipart
|
// Upload with simple or multipart
|
||||||
if size <= int64(o.fs.opt.UploadCutoff) {
|
if size <= int64(o.fs.opt.UploadCutoff) {
|
||||||
err = o.upload(ctx, in, leaf, directoryID, modTime)
|
err = o.upload(ctx, in, leaf, directoryID, modTime, options...)
|
||||||
} else {
|
} else {
|
||||||
err = o.uploadMultipart(ctx, in, leaf, directoryID, size, modTime)
|
err = o.uploadMultipart(ctx, in, leaf, directoryID, size, modTime)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue