order |
---|
1 |
Ember FileUpload is an ember addon that makes uploading files easy.
Uploads can be managed through queues and continue in the background, even after a page transition. In other words they are persistent across routes in your application.
ember install ember-file-upload
Queues contain the state of file uploads as a user navigates around your application. They are the core of this addon.
To access a queue in your templates compose the let
helper with the file-queue
helper like this:
The name
property is optional but recommended as you may manage multiple queues in the future.
ℹ️ You can also access queues in your app JavaScript by injecting the
fileQueue
service.export default class ExampleComponent extends Component { @service fileQueue; get queue() { return this.fileQueue.findOrCreate('photos'); } }
Once you have access to a queue, you can start Uploading files.