如何解决从Flutter中的设备上的Firebase存储下载并存储文件会引发错误
我正在尝试通过flutter将excel文件从firebaseStorage下载到我的设备上。 我收到我的文件不存在但确实存在的错误。
// Creating a temp directory,file and the file path
final String filePath = 'excels/2020-8-10.xlsx';
final Directory tempDir = Directory.systemTemp;
final File file = File('${tempDir.path}/$filePath');
// Accessing the file in the FirebaseStorage
StorageReference ref =
FirebaseStorage.instance.ref().child(filePath);
// Writing to the previously created file from the file in the FirebaseStorage
final StorageFileDownloadTask downloadTask = ref.writeToFile(file);
// Await till the file is completly written by counting the total bytes
final int byteNumber = (await downloadTask.future).totalByteCount;
print(byteNumber);
这是我得到的错误:
Exception has occurred.
PlatformException (PlatformException(download_error,An unknown error occurred,please check the HTTP result code and inner exception for server response.,null))
E/StorageException(10217): No such file or directory
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。