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 Upload currupting files #147

Closed
maxigs opened this issue Feb 19, 2017 · 4 comments
Closed

S3 Upload currupting files #147

maxigs opened this issue Feb 19, 2017 · 4 comments

Comments

@maxigs
Copy link

maxigs commented Feb 19, 2017

Hi,

i'm currently trying to upload some files from a little EmberJS app with the ember-uploader.
While the upload seems to work fine, all the files are corrupted on S3.

It seems that the stored files content type is form-data. Looking into the code of ember-uploader i see that it's submitting a form-data object to S3. I think this should be just the file itself?

Or do i overlook something in the documentation?

Thanks :)

@maxigs
Copy link
Author

maxigs commented Feb 19, 2017

I really missed the part in the documentation where it says to use the other uploader, my bad 😊

@maxigs maxigs closed this as completed Feb 19, 2017
@stevenwu
Copy link

stevenwu commented Mar 9, 2017

@maxigs I'm having the same issue. How did you fix this? Thanks.

@maxigs
Copy link
Author

maxigs commented Mar 10, 2017

I did actually use a different plug-in now, which i had to add s3 support to:

https://github.com/maxigs/ember-file-upload i didn't have the chance to make it a proper pull request yet to get it upstream, but it did work for when i tried it out like this.

@ezekg
Copy link

ezekg commented Aug 7, 2018

Just a quick solution for future reference to anyone who hits this issue:

import EmberUploader from 'ember-uploader'
import Ember from 'ember'

const { Uploader } = EmberUploader
const { get, set } = Ember

const BinaryUploader = Uploader.extend({
  upload(file) {
    const url    = get(this, 'url')
    const method = get(this, 'method')

    set(this, 'isUploading', true)

    return this.ajax(url, file, method)
  }
})

Solving #163 would probably fix this issue as well.

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

3 participants