Reputation: 365
Using ember-paper I tried to upload a file (image) to a server (expressJS) but I can't get the file.
#template.hbs
{{paper-input
type="file"
file=file
onChange=(action (mut file))
}}
{{#paper-button onClick=(action 'submit')}}submit{{/paper-button}}
#controller.js
actions: {
submit() {
console.log(this.get('file'));
}
}
Tried several combinations but always got 'undefined'.
Upvotes: 1
Views: 249
Reputation: 77
It appears the onChange
method is never called. onChange
is linked to the HTML input attribute oninput
which is not supported for input type file
.
I spoke with Miguel about the fix.
Upvotes: 1