I am trying to get an Amazon S3 Plupload example while working with Node.js. However, so far I have managed to get Error #2049 . I'm not sure what I'm doing wrong. I uploaded the crossdomain.xml file.
Here is my political document and signature:
var crypto = require('crypto'); var s3 = {} s3.bucket = 'BUCKET'; s3.accessKeyId = 'ACCESS_KEY'; s3.aws_secret_key = 'SECRET_KEY'; s3.policy = JSON.stringify({ 'expiration': '2012-10-01T00:00:00Z', 'conditions': [ {'bucket': s3.bucket }, {'acl': 'private'}, ['starts-with', '$key', ''], ['starts-with', '$Content-Type', ''], ['starts-with', '$name', ''], ['starts-with', '$Filename', ''], {"success_action_status" : "201"} ]}); s3.policy = new Buffer(s3.policy).toString('base64'); s3.signature = crypto.createHmac('sha1', s3.aws_secret_key).update(s3.policy).digest('base64');
Am I doing something wrong?
source share