UploadController
JavaScript file uploading mechanism with default (optional) XHR backend. To be consumed by file picker and image picker components.
Usage
var UploadControllerFactory = ; var UploadController = ; var file1 = ; // attach file1 to file picker component or image component // or file1; // start upload selected file // returns promise on finish // file1.$state = 1 is empty, 2 is uploading, 3 is finished // file1.$pr = Upload progress report: 0 is 0% percent, 1 is 100% percent // file1.$blob_url = Locally cached Blob resource, can be used in <img> tags or to display a PDF in a new window. file1; // defines already uploaded file var file2 = ; // can be attached to file picker component or image component, and the component will show the previously selected file.
License
© 2019 Burak Tamturk
Released under the MIT LICENSE