Amazon S3-bucket MalformedXML Fehler beim hochladen

Ich versuche, ein Bild hochzuladen auf meinen Amazon S3-bucket. Hier ist der code für meine XMLHttpRequest:

var form_data = new FormData();
form_data.append(filename, file);
var xhr = new XMLHttpRequest();
xhr.open('PUT', 'https://bucket-name.s3.amazonaws.com', true);
xhr.send(form_data);

Habe ich so konfiguriert das CORS zu werden, wie folgt:

<CORSConfiguration>
  <CORSRule>
    <AllowedOrigin>http://localhost:3000</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
  </CORSRule>
</CORSConfiguration>

Leider, bekomme ich immer die folgende Fehlermeldung, wenn ich versuche zu laden, es:

PUT https://bucket-name.s3.amazonaws.com 400 (Bad Request)
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>MalformedXML</Code><Message>The XML you provided was not well-formed or 
did not validate against our published schema</Message><RequestId>6188AA51D1EE6B38</RequestId>
<HostId>f3d5Aj8bMyMOJywRnYKH/tBXRHCDWFvNzcb4ejs9F4/IulP1P2n0XoN1mDq7LpQgL/RIsW1c6RA=</HostId></Error>

Weiß jemand, was ich falsch mache?

InformationsquelleAutor user3579220 | 2015-08-05
Schreibe einen Kommentar