April 2018
Intermediate to advanced
284 pages
6h 43m
English
Cloud Storage allows you to manage the file uploads; you can resume, pause, or cancel the upload. The corresponding methods are available on UploadTask, which is returned by the put() or putString() methods that can be used as a promise or use to manage and monitor the status of the upload:
// Upload the file and metadatavar uploadTask = storageRef.child('folder/file.jpg').put(file);// Pause the upload - state changes to pauseuploadTask.pause();// Resume the upload - state changes to runninguploadTask.resume();// Cancel the upload - returns an error indicating file upload is cancelleduploadTask.cancel();
You can use the 'state_change' observer to listen to the progress events. It is very useful if you want ...