Uploading files on a client side application is often used. It would be nice to have a helper that provides details on the upload to show progress and state.
The function should accept:
url
method (POST/PUT/...).
The signals it could return are:
State (waiting, uploading(x bytes, total bytes), done)
Trigger/Start the upload, you may want to queue the upload
Cancel/abort the upload
Optional callback with the state where you want to manage some other state when the state changes
Uploading files on a client side application is often used. It would be nice to have a helper that provides details on the upload to show progress and state.
The function should accept:
url
method
(POST/PUT/...).The signals it could return are:
State
(waiting, uploading(x bytes, total bytes), done)Trigger
/Start
the upload, you may want to queue the uploadCancel
/abort
the uploadcallback
with the state where you want to manage some other state when the state changes