We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Guys could you create a readme area to explain how to upload only when a user clics on a submit button / action ?
The text was updated successfully, but these errors were encountered:
It's relatively simple
use file-upload component
import EmberUploader from 'ember-uploader' export default EmberUploader.FileField.extend({});
add event handler in template
file-upload filesDidChange=(route-action 'filesChanged')
in route / controller handle the event, the first argument will be the files list
filesChanged(files) { set(this, 'currentModel', files) }
then just create an uploader in your save handler, whatever that may be, mine is a ember-concurrency task
uploadTask: task(function*() { const files = get(this, 'currentModel') const uploader = EmberUploader.Uploader.create({ url: `${ENV.APP.apiUrl}/import/users` }); if (!isEmpty(files)) { yield uploader.upload(files[0]).then( () => { this.notify.success({ title: 'Data Imported Successfully' }) this.transitionTo('integrations.index') }).catch( error => { this.notify.error({ title: 'Data Import Error', blurb: error.message }) }) } })
Sorry, something went wrong.
No branches or pull requests
Guys could you create a readme area to explain how to upload only when a user clics on a submit button / action ?
The text was updated successfully, but these errors were encountered: