Closed Jaicob closed 8 years ago
Set the file in the data object, not fields:
data: {
'key' : 's3UploadExample/'+ Math.round(Math.random()*10000) + '$$' + file.name,
'acl' : 'public-read',
'Content-Type' : file.type,
'AWSAccessKeyId': s3Params.AWSAccessKeyId,
'success_action_status' : '201',
'Policy' : s3Params.s3Policy,
'Signature' : s3Params.s3Signature,
file: file
}
If you try to use the latest version of ng-file-upload you will receive this error
InvalidArgumentBucket POST must contain a field named 'key'. If it is specified, please check the order of the fields.
The solution is to change data to fields in the upload portion of the onfileSelcect method. The new method will look like so