mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
copyurl: Add option to honor the HTTP header filename directive.
Implemented --header-filename for use with copyurl. For specifically setting preferred download filenames for HTTP requests, RFC 6226 specifies a 'filename' directive, available within 'Content-Disposition' header. We can handle with 'mime.ParseMediaType'. See below for details: https://httpwg.org/specs/rfc6266.html#disposition.parameter.filename https://httpwg.org/specs/rfc6266.html#advice.generating Co-authored-by: buengese <buengese@protonmail.com>
This commit is contained in:
committed by
Nick Craig-Wood
parent
f2a15a174f
commit
8b8802a078
@@ -274,8 +274,9 @@ func rcSingleCommand(ctx context.Context, in rc.Params, name string, noRemote bo
|
||||
}
|
||||
autoFilename, _ := in.GetBool("autoFilename")
|
||||
noClobber, _ := in.GetBool("noClobber")
|
||||
headerFilename, _ := in.GetBool("headerFilename")
|
||||
|
||||
_, err = CopyURL(ctx, f, remote, url, autoFilename, noClobber)
|
||||
_, err = CopyURL(ctx, f, remote, url, autoFilename, headerFilename, noClobber)
|
||||
return nil, err
|
||||
case "uploadfile":
|
||||
|
||||
|
||||
Reference in New Issue
Block a user