Posts

Post not yet marked as solved
5 Replies
5.3k Views
I built a web app that allows a user to upload files to an Amazon s3 bucket via a webform, I unfortualy am in a sandboxed evnoronment and cannout make a JS httprequest to s3. Anyway, Amazon send a 204 response back if the PUT was a success, unless you specify it to respond with a 201. I've searched exhaustivly around the net and have found mutple older stackoverflow topics and similar sites refering to this same issue with Amazon S3 or with 204 responsess in general, on iOS. I have tested the app on multipel Android devices, in Chrome as well as all major desktop clients and it works as expected.In iOS based browsers, it returns a blank page, which is what a 204 is but that is not what the HTTP 1.1 Specs say a 204 shoudl do on a client. Can anyone help me fix this? Suggest a solution or a direction to look? What I can offer are these things :Amazon's documentation of POST responses :The status code returned to the client upon successful upload if success_action_redirect is not specified.Accepts the values 200, 201, or 204 (default).If the value is set to 200 or 204, Amazon S3 returns an empty document with a 200 or 204 status code.If the value is set to 201, Amazon S3 returns an XML document with a 201 status code.If the value is not set or if it is set to an invalid value, Amazon S3 returns an empty document with a 204 status code.Type: StringDefault: NoneNoteSome versions of the Adobe Flash player do not properly handle HTTP responses with an empty body. To support uploads through Adobe Flash, we recommend setting success_action_status to 201.The HTTP 1.1 Spec for a 204 response via the W3C :The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant.If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent's active view.The 204 response MUST NOT include a message-body, and thus is always terminated by the first empty line after the header fields.Here is a nice little tool for testing responses :http://httpstat.us/Clicking the 204 link should cause your browser to load for a second and then the page not do anything. This works as expected in all browsers, except ones running on iOS. My devices are at version 10.2.Again, I am at the mercy of Safari (the Client), this is a simple form POST that recieves a 204 response, I can not catch the response and rely on the client to handle it correclty, which it appears to not do. Thank you for your help
Posted Last updated
.