[storage][js] automatically attempt to call `decodeURI` on `putFile` paths

This commit is contained in:
Salakar 2018-07-07 02:30:23 +01:00
parent be048e9d39
commit 259f8f8d1b
1 changed files with 2 additions and 1 deletions

View File

@ -96,7 +96,8 @@ export default class StorageReference extends ReferenceBase {
* @return {Promise}
*/
putFile(filePath: Object, metadata: Object = {}): Promise<Object> {
const _filePath = filePath.replace('file://', '');
let _filePath = filePath.replace('file://', '');
if (_filePath.includes('%')) _filePath = decodeURI(_filePath);
return new StorageTask(
UPLOAD_TASK,
getNativeModule(this._storage).putFile(this.path, _filePath, metadata),