Open aenario opened 8 years ago
We need to find a proper API, I offer :
Option 1 - mikeal/request like, where we return the xhr object, so the app can setup its listeners
file = document.getElementbyId('input_file').files[0] request = cozysdk.attachBinary 'Note', 454id543, 'binary_name.ext', file, callback request.addEventListener("abort", transferCanceled); request.upload.addEventListener("progress", updateProgress); request.upload.addEventListener("abort", transferCanceled);
Option 2 - with a progressback
file = document.getElementbyId('input_file').files[0] progressback = (event) -> event instanceof ProgressEvent cozysdk.attachBinary 'Note', 454id543, 'binary_name.ext', file, callback, progressback
*1 event is a ProgressEvent
Option 3 - only provide the url, and some doc on how to use it with <form>
<form>
We need to find a proper API, I offer :
Option 1 - mikeal/request like, where we return the xhr object, so the app can setup its listeners
Option 2 - with a progressback
*1 event is a ProgressEvent
Option 3 - only provide the url, and some doc on how to use it with
<form>