Hello,
How can I update user profile photo?
The photo located on FireStore and I send the path to the the following function.
AmityCoreClient.newFileRepository()
.uploadImage(imageFile)
.stream
.listen((AmityUploadResult<AmityImage> amityResult) {
amityResult.when(
progress: (uploadInfo, cancelToken) {print('kobi - amity - uploadAvatar progress${uploadInfo.getProgressPercentage()}');},
complete: (file) async {
//proceed result with uploadedImage
await updateUserAvatar(file.fileId);
retCode = true;
},
error: (error) {
retCode = false;
},
cancel: () {
retCode = false;
},
);
});
and have the error -
I/flutter (27966): , exception: PathNotFoundException: Cannot retrieve length of file, path = ‘https://firebasestorage.googleapis.com/v0/b/aller-17969.appspot.com/o/profileImage%2FopGhHNaUTKdvD7feBIFScl4iDDi1%2F8cc42aa0-215f-11ee-aeab-4d38f67d02b9?alt=media&token=ed552de3-351d-4ede-a599-f6157192198f’ (OS Error: No such file or directory, errno = 2), device: Android-220333QAG, version: --1020-1020-BaseDeviceInf