I have a form that makes a POST request directly to an Amazon S3 bucket with a file attachment. In Firefox it works fine. In Chrome, I get a 412 error
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>PreconditionFailed</Code>
<Message>At least one of the pre-conditions you specified did not hold</Message>
<Condition>Bucket POST must be of the enclosure-type multipart/form-data</Condition>
<RequestId>randomcharacters123456</RequestId>
<HostId>morerandomcharacters123456</HostId>
</Error>
Is there supposed to be a difference in the way these browsers handle and submit forms? The form has the attribute enctype=multipart/form-data
set fine. The only real difference I saw in the POST requests was the request payload boundary.
Chrome shows something like ------WebKitFormBoundary27B45bsnJm6YBk66
Firefox shows something like -----------------------------185573058924207
But I assume these are trivial differences.
Do I have to cater enctypes to particular browsers? Can I force Chrome to handle the enctype properly?
Aucun commentaire:
Enregistrer un commentaire