-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add the option to skip form data insertion (won't change default functionality) #163
Comments
I guess I don't really understand the problem here. There should be a single |
Hey digitaltoad, you're right, this issue can be closed. Thanks! |
As mentioned in #147, form data is not required, and messes with uploads that should be a binary upload. For example, AWS S3 doesn't support form data (and I'm not sure how it's working for other people, to be honest). I'm using this modified uploader below to be able to upload to S3: 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)
}
}) I was seeing issues where the uploader would send |
The extra form data that is inserted for files can cause issues on the other hand, I suggest adding a optional property of "skipFormData" (Boolean) to the uploader object. Example:
Then inside the /addon/uploaders/base.js on line 63 the data can be changed to be:
This will skip the form data if the property is set to true, and create the form data if the property is set to false, or is not present.
The text was updated successfully, but these errors were encountered: