Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 throw me a 204 No Content #86

Open
ThibaudDenolle opened this issue Jan 16, 2017 · 1 comment
Open

S3 throw me a 204 No Content #86

ThibaudDenolle opened this issue Jan 16, 2017 · 1 comment

Comments

@ThibaudDenolle
Copy link

I am facing issues since now 2 weeks, making progress piece after piece. I do not know If that is an issue or if I am the issue so sorry if I am disturbing and thanks for your great job!

I want to do direct upload to S3. I think my bucket is in a new region (eu-west-2) that only supports aws4 signing. So I followed step by step the aws documentation and rewrite the S3Direct model to change the StringToSign and the SigningKey to generate the signature and the policy.

The aws seems to work now, the preflight and the POST request
screen shot 2017-01-15 at 20 21 17

I still have my file name and it's type but nothing in my payload in terms of data:
screen shot 2017-01-15 at 20 21 38

I do nothing neither in my controller:

        getJSON('http://localhost:4200/api/v1/presign').then((response) => {
          return file.upload(response.url, {
            data: response.credentials
          });
        })

neither in my template which is a copy past of the one in the Readme (appart from a pair of

).

I had checked the plupload documentation but I didn't find anything relevant... If you can help me, I am stuck for so long on that ^^. One more time sorry for the disruption if the mistake comes from me!

Thanks

@ThibaudDenolle
Copy link
Author

I have rewritten the upload method as follow:

        getJSON('http://localhost:4200/api/v1/presign').then(function (response) {
          /* file.upload(response.url, {
            data: response.credentials
          }); */
          var s3_signed = response.credentials
          var formData = new FormData(),
              xhr = new XMLHttpRequest();

          formData.append('name', filename);
          for (var key in s3_signed) {
            formData.append(key, s3_signed[key]);
          }
          formData.append('Content-type', "");
          formData.append('file', file);
          xhr.open('POST', response.url);
          xhr.send(formData);
        })

And now I have this strange thing instead of the file content: <(unknown mixin):ember672>

screen shot 2017-01-22 at 20 41 36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant