从Firebase存储下载时出错
我正在尝试下载我上传到firebase的图像 我将下载url作为httpPath传递。但是从Firebase存储下载时出错,firebase,flutter,firebase-storage,Firebase,Flutter,Firebase Storage,我正在尝试下载我上传到firebase的图像 我将下载url作为httpPath传递。但是E/StorageException(16586):发生了StorageException。 E/StorageException(16586):位置不存在对象。 E/StorageException(16586):代码:-13010 HttpResult:404 E/StorageException(16586):发生StorageException。 E/StorageException(16586):
E/StorageException(16586):发生了StorageException。
E/StorageException(16586):位置不存在对象。
E/StorageException(16586):代码:-13010 HttpResult:404
E/StorageException(16586):发生StorageException。
E/StorageException(16586):该位置不存在对象。
Future<Null>downloadFile(String httpPath) async{
final Directory appDir = await getApplicationDocumentsDirectory();
final appDirPath = appDir.path;
final RegExp regExp = RegExp('([^?/]*\.(jpg))');
final filename = regExp.stringMatch(httpPath);
final File thefile = File('${appDirPath}/$filename');
final StorageReference sref = FirebaseStorage.instance.ref().child('storeFolderName').child(filename);
final StorageFileDownloadTask fileDownloadTask = sref.writeToFile(thefile);
final int byteNumber = (await fileDownloadTask.future).totalByteCount;
print('your file byte number is : $byteNumber');
}
FuturedownloadFile(字符串httpPath)异步{
最终目录appDir=wait getApplicationDocumentsDirectory();
最终appDirPath=appDir.path;
最终RegExp RegExp=RegExp(“([^?/]*\(jpg))”;
最终文件名=regExp.stringMatch(httpPath);
最终文件文件=文件('${appDirPath}/$filename');
final-StorageReference sref=FirebaseStorage.instance.ref().child('storeFolderName').child(文件名);
final-StorageFileDownloadTask fileDownloadTask=sref.writeToFile(文件);
final int byteNumber=(等待fileDownloadTask.future);
打印('您的文件字节号为:$byteNumber');
}
可能文件在“sref”处不存在。确保正则表达式提供了所需的输出文件名在使用不同的错误代码实现firabase消息传递后,我也面临着相同的问题,以前也遇到过相同的问题,没有任何问题(代码:-13000 HttpResult:0),对此有何解决方法