-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not working for s3 #14
Comments
The err is "Error happened: Bad Request" |
Hi @skyride99 , please try my answer here: #17 and report how it works |
Yes that is the fix it needs to be 'file'. |
Yeah, and the two pull requests contain both the solution ;) |
I had a lot of trouble getting our S3 uploads to work (the usual vague FORBIDDEN error). I eventually added the option to disable multipart uploads and just use a signed request (i.e. PUT instead of POST). It seemed somewhat simpler and was in line with what we were doing otherwise. It's a little rough (must include |
Using RN 17. Below is the code.
var obj = {
uploadUrl: 'http://makeuroffer.s3.amazonaws.com',
method: 'POST', // default 'POST',support 'POST' and 'PUT'
headers: {
//'contentType': 'image/jpeg',
'Accept': 'application/json',
},
fields: {
"acl": "public-read" ,
"Content-Type": "image/" ,
"key": 'biz/' + 'third.jpg' ,
"x-amz-meta-tag": '' ,
"x-amz-meta-uuid": "14365123651274",
"bucket": 'makeuroffer' ,
"x-amz-algorithm": "AWS4-HMAC-SHA256" ,
"x-amz-credential": data.key + "/" + moment().format('YYYYMMDD') + "/" + 'us-west-2' + "/" + 's3' +"/aws4_request" ,
"x-amz-date": data['x-amz-date'] , //'20160112T105326Z'
"policy": data.policy,
"x-amz-signature": data['x-amz-signature']
},
files: [
{
//name: 'filename', // optional, if none then
filename
is used insteadfilename: 'more.jpg', // require, file name
filepath: pic.uri, // require, file absoluete path
//filetype: 'audio/x-m4a', // options, if none, will get mimetype from
filepath
extension},
]
};
The text was updated successfully, but these errors were encountered: