Help about setting file max size and type in the policy document

dreamobjects

#1

Hi guys,

Can someone direct me to how I can setup the policy document, I would like to use “starts-with” to restrict accepted file to jpeg, png and pdf, also I would like to restrict the file size using “content-length-range”, but I have no idea how I can set the policy document ? and what to write on it exactly ?

Thank you in advance!


#2

Shared Hosting, VPS, Dreampress, Dedicated Server or DreamCompute instance?

How/Where are these files being uploaded?


#3

I think I posted this in DreamObjects forum ! So this is related to DreamObjects S3 API, sorry if my question wasn’t clear, I should specify that


#4

You’re on the right track! The S3 documentation has good info on post uploads via a vanilla HTML form. http://docs.aws.amazon.com/AmazonS3/latest/dev/HTTPPOSTForms.html

There are also examples on using them on the next page - http://docs.aws.amazon.com/AmazonS3/latest/dev/HTTPPOSTExamples.html

I know from your other post that you’re using ruby, so this may be helpful also - http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/PresignedPost.html