val httpReference = firebaseStorageInstance.getReferenceFromUrl(dataModel.remoteFileUrl)
val localFile = FileHelper.getFileName(dataModel.fileName)
val file = File(localFile)
httpReference.getFile(file).addOnSuccessListener {
//Log
}.addOnFailureListener {
//Log
}
我的dataModel.remoteFileUrl就像这样的“ https://firebasestorage.googleapis.com/v0/b/app.appspot.com/o/testapp%2Ffiles%2Fnew_28_156403158_%20ticket%20.pdf?alt=media&token=066d143b-aa6a-4ab8-94b0”
从浏览器打开该下载网址时,它会显示pdf文件,但在具有上述代码的Android中,总是会在存储异常时击中onfailureListener android.system.ErrnoException:打开失败:ENOENT(没有这样的文件或目录)