Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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


Mihael Konjević

June 27, 2014

More Decks by Mihael Konjević

Other Decks in Technology


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

  2. 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
  3. • 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
  4. 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
  5. Resources • can.Component • jQuery-file-upload • Demo

  6. Thanks @mihaelkonjevic