I have been trying to implement FineUploader in Rails and I am running into the following error:
Invalid according to Policy: Extra input fields: success_action_status
I am using the example from the FineUploader docs and my signature and policy signing are coming through properly. It looks like FineUploader is passing "success_action_status" in the POST to S3 and that is causing the issue?
Does anyone know if I need to add something additional to my bucket policy on S3 or do I need to change a parameter on FineUploader?
Here is the implementation that I am using for the FineUploader JS control:
var uploader = new qq.s3.FineUploader({
element: document.getElementById('fine-uploader'),
request: {
endpoint: 'https://MyBUCKET.s3.amazonaws.com/',
accessKey: 'MY_ACCESS_KEY'
},
signature: {
endpoint: 'home/generatesignature'
},
uploadSuccess: {
endpoint: '/s3/success'
},
iframeSupport: {
localBlankPagePath: '/success.html'
}
});
Update After going around with trying to get Rails to work with FineUploader I was finally able to get it to work. For anyone that runs into issues with implementing FineUploader/Rails the key is that the S3 policy is sent in the post body to the server and that is what needs to be encoded and signed before returning. Here is the action to make everything work serverside in Rails
def generatesignature
policy = Base64.encode64(request.raw_post).gsub("\n","")
s3_signature = Base64.encode64(
OpenSSL::HMAC.digest(
OpenSSL::Digest::Digest.new('sha1'),
'YOUR_SECRET_KEY', policy)
).gsub("\n","")
params[:signature]= s3_signature
params[:policy] = policy
render :json => params, :status => 200 and return
end