forked from TrueCloudLab/rclone
fichier: pass options to rest.Opts for uploadFile
This commit is contained in:
parent
854c84d0ca
commit
fc946d0c44
2 changed files with 3 additions and 2 deletions
|
@ -320,7 +320,7 @@ func (f *Fs) getUploadNode(ctx context.Context) (response *GetUploadNodeResponse
|
||||||
return response, err
|
return response, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Fs) uploadFile(ctx context.Context, in io.Reader, size int64, fileName, folderID, uploadID, node string) (response *http.Response, err error) {
|
func (f *Fs) uploadFile(ctx context.Context, in io.Reader, size int64, fileName, folderID, uploadID, node string, options ...fs.OpenOption) (response *http.Response, err error) {
|
||||||
// fs.Debugf(f, "Uploading File `%s`", fileName)
|
// fs.Debugf(f, "Uploading File `%s`", fileName)
|
||||||
|
|
||||||
fileName = f.opt.Enc.FromStandardName(fileName)
|
fileName = f.opt.Enc.FromStandardName(fileName)
|
||||||
|
@ -338,6 +338,7 @@ func (f *Fs) uploadFile(ctx context.Context, in io.Reader, size int64, fileName,
|
||||||
NoResponse: true,
|
NoResponse: true,
|
||||||
Body: in,
|
Body: in,
|
||||||
ContentLength: &size,
|
ContentLength: &size,
|
||||||
|
Options: options,
|
||||||
MultipartContentName: "file[]",
|
MultipartContentName: "file[]",
|
||||||
MultipartFileName: fileName,
|
MultipartFileName: fileName,
|
||||||
MultipartParams: map[string][]string{
|
MultipartParams: map[string][]string{
|
||||||
|
|
|
@ -338,7 +338,7 @@ func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = f.uploadFile(ctx, in, size, leaf, directoryID, nodeResponse.ID, nodeResponse.URL)
|
_, err = f.uploadFile(ctx, in, size, leaf, directoryID, nodeResponse.ID, nodeResponse.URL, options...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue