Following this tutorial to Store Image path to Firebase Storage
Here is my code:
StorageReference storageReference = FirebaseStorage.getInstance().getReference();
String STORAGE_PATH_UPLOADS = "Profile Pictures/" + UID + "/" + imgID;
StorageReference sRef = storageReference.child(STORAGE_PATH_UPLOADS + "." + "jpg");
sRef.putFile(imgPath)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Toast.makeText(mContext, "uploaded successfully", Toast.LENGTH_SHORT).show();
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
Exception:
StorageException: StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 0
I searched on this but didn't get any solution