update file upload error handling docs
This commit is contained in:
parent
43410bbadd
commit
946736b0c9
|
@ -34,18 +34,20 @@ firebase.storage()
|
|||
### Listen to upload state
|
||||
|
||||
```javascript
|
||||
const unsubscribe = firebase.storage()
|
||||
const uploadTask = firebase.storage()
|
||||
.ref('/files/1234')
|
||||
.putFile('/path/to/file/1234')
|
||||
.on('state_changed', snapshot => {
|
||||
.putFile('/path/to/file/1234');
|
||||
|
||||
const unsubscribe = uploadTask.on('state_changed', snapshot => {
|
||||
//Current upload state
|
||||
}, err => {
|
||||
//Error
|
||||
unsubscribe();
|
||||
}, uploadedFile => {
|
||||
}, null, uploadedFile => {
|
||||
//Success
|
||||
unsubscribe();
|
||||
});
|
||||
uploadTask.catch(err => {
|
||||
//Error
|
||||
unsubscribe();
|
||||
});
|
||||
```
|
||||
|
||||
## Downloading files
|
||||
|
|
Loading…
Reference in New Issue