figuedmundo
figuedmundo

Reputation: 365

How to get a file in order to upload it to server (ember-paper)

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

Answers (1)

Jordan Harris
Jordan Harris

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

Related Questions