TTLabs / EvaporateJS

Javascript library for browser to S3 multipart resumable uploads
1.82k stars 207 forks source link

XML Parsing Error #410

Open Ailrun opened 6 years ago

Ailrun commented 6 years ago

I try to use this library, and console says XML Parsing Error: no root element found continuously. It works, but the error message really bothers me. Did I do something wrong?

Adding part of my code is,

evaporate.add({
  name: fileKey,
  file,
  progress(percentage) {
    if (percentage === 1) {
      evaporate.cancel(fileKey);
      evaporate.add({
        name: fileKey,
        file,
        complete(): void {
          cb('complete');
        },
      });
    }
    cb('progress', percentage);
  },
});

P.S. I found this weird workaround (calling add twice) from https://github.com/TTLabs/EvaporateJS/issues/365#issuecomment-308934095, but I want to know right way to solve InvalidPart error... (FYI, I already checked my CORS setting) P.S.2. This workaround doesn't work with large files.... :(

Ailrun commented 6 years ago

Is there anyone?

thomas-profitt commented 5 years ago

I hit this same snag.

The issue isn't that the responses to the PUT requests are missing their XML bodies, but that they're missing their ETag headers.

The solution for me was to add <ExposeHeader>ETag</ExposeHeader> (not to be confused with AllowedHeader, and that's ExposeHeader, not ExposedHeader) to my bucket's CORS configuration, as described here: https://github.com/aws/aws-sdk-js/issues/191