I use signed POST to upload a file directly to Amazon S3. I had some problems with the policy signatures using PHP, but finally it was fixed and here is the sample code .
This xhr request is sent to javascript and I am waiting for a response from amazon. First I used success_action_status , setting it to 201 to get an XML response.
What I would like to do is use success_action_redirect to call a script on my server to create a record in the database.
The reason I can create an entry in the database, and if something wrong happens at this point, I can immediately send an error message. It also saves me another ajax request to my server.
So, I tried to set this by pointing success_action_redirect to http:\\localhost\callback.php , where I have a script that is waiting for some parameters.
But it looks like this script is never called, and the response of xhr.send() empty.
I think this is a cross browser issue, and I wonder if it is possible to use jsonp somehow to pass this? Any ideas?
UPDATE
Apparently, xhr should be redirected initially, so it should work, but when I specified success_action_redirect , it returns error Server responded with 0 code.
At first, I thought this was because the redirect URL was on my local server, so I changed it to an available server, but no chance.
Does anyone know why it is returning this error message?