presign_post
¶
presign_post(
bucket: BucketName,
key: ObjectKey,
*,
expires_in: int = 3600,
fields: Mapping[str, str] | None = None,
conditions: Sequence[PostCondition] | None = None,
config_overrides: S3ClientConfig | None = None,
) -> PresignedPost
A form that uploads an object to the bucket, usable without credentials: POST its fields to its url as multipart/form-data, followed by the file field.
Parameters:
-
bucket(BucketName) –The bucket to upload to.
-
key(ObjectKey) –The key of the uploaded object. It is matched exactly, unless a
starts-withcondition onkeysays how it starts, which a key ending with${filename}needs. -
expires_in(int, default:3600) –How long the form stays valid, in seconds.
-
fields(Mapping[str, str] | None, default:None) –Form fields with a fixed value, such as
aclorContent-Type. Each is returned infieldsand pinned to its value by the policy. -
conditions(Sequence[PostCondition] | None, default:None) –Policy conditions on the fields the uploader adds, such as
{"type": "starts-with", "field": "Content-Type", "prefix": "image/"}or{"type": "content-length-range", "min": 0, "max": 1048576}. Aneqcondition has one value to send, so it is returned infieldslike an entry offields.