generate_presigned_post
(Bucket, Key, Fields=None, Conditions=None, ExpiresIn=3600)¶Builds the url and the form fields used for a presigned s3 post
conditions
parameter.Fields
or Conditions
parameter.A dictionary of prefilled form fields to build on top of. Elements that may be included are acl, Cache-Control, Content-Type, Content-Disposition, Content-Encoding, Expires, success_action_redirect, redirect, success_action_status, and x-amz-meta-.
Note that if a particular element is included in the fields dictionary it will not be automatically added to the conditions list. You must specify a condition for the element as well.
A list of conditions to include in the policy. Each element can be either a list or a structure. For example:
]
Conditions that are included may pertain to acl, content-length-range, Cache-Control, Content-Type, Content-Disposition, Content-Encoding, Expires, success_action_redirect, redirect, success_action_status, and/or x-amz-meta-.
Note that if you include a condition, you must specify the a valid value in the fields dictionary as well. A value will not be added automatically to the fields dictionary based on the conditions.
dict
A dictionary with two elements: url
and fields
.
Url is the url to post to. Fields is a dictionary filled with
the form fields and respective values to use when submitting the
post. For example:
'key': 'mykey', 'signature': 'mysignature', 'policy': 'mybase64 encoded policy'}
}