Slide 1

Slide 1 text

File uploading with can.Component (and jQuery-file-upload)

Slide 2

Slide 2 text

File Uploading • Use different endpoints for uploads and file metadata • Makes it easy to upload directly to a different server via iframe (eg. S3) File upload endpoint File metadata endpoint File Uploader (Component) Upload file Get Metadata Save Metadata

Slide 3

Slide 3 text

• If file is currently uploaded cancel the action • If file is already uploaded delete it • UI is the same for both actions Cancelling the upload Cancel Upload Delete File

Slide 4

Slide 4 text

Events are your friends • Use events to integrate jQuery-file-upload • `events` object in can.Component is a can.Control instance • Update progress of the file upload • Know when upload is done • When `file` is removed from the `scope.files` list, cancel the upload or delete the file

Slide 5

Slide 5 text

Resources • can.Component • jQuery-file-upload • Demo

Slide 6

Slide 6 text

Thanks @mihaelkonjevic