amazon web services - S3 Pre-signed POST validate file type? -


i know it's possible put limit on file size content-length-range header. possible validate file type?

https://docs.aws.amazon.com/amazons3/latest/dev/httppostforms.html#policyconditions

i see there content-type header, if set say, audio/mp3 allow mp3 files , return error if file not mp3?

i found previous question answers mention validating file size: s3 direct upload restricting file size , type

you can specify content-type @ post request.

you can specify @ signature, post must done content-type:

{ "expiration": "2007-12-01t12:00:00.000z",   "conditions": [     {"acl": "public-read" },     {"bucket": "johnsmith" },     {"content-type: "audio/mp3"}   ] } 

creating html form (using aws signature version 4)

edit: @ previous question found, checking content-type.


Comments

Popular posts from this blog

c# - Check Keyboard Input Winforms -