StorageException: An unknown error occurred, please check the HTTP result code and inner exception for server response

前端 未结 13 2038
执念已碎
执念已碎 2021-02-09 20:19

I use Firebase Storage to upfile. But it does not work THIS IS MY CODE.

FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference sto         


        
13条回答
  •  日久生厌
    2021-02-09 20:34

    Using putStream() is the the recommended way for most files instead of putFile() (for local files on the device) like so:

    InputStream stream = new FileInputStream(new File(pathToYourFile)));
    
    UploadTask uploadTask = imageFileStorageReference.putStream(stream);
    

提交回复
热议问题