Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.21 KB

index.md

File metadata and controls

43 lines (31 loc) · 1.21 KB
order
1

Getting started

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.

Installation

ember install ember-file-upload

Introducing queues

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:

{{#let (file-queue name="photos") as |queue|}}
  Files in queue: {{queue.files.length}}
{{/let}}

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.