小编qin*_*ing的帖子

如何解决操作系统错误:权限被拒绝,颤动中的 errno = 13

我是 Flutter 的新手。我想将我的文档文件存储'/storage/emulated/0/Download/'。我有错误Unhandled Exception: FileSystemException: Cannot open file, path = '/storage/emulated/0/Download/file.pdf' (OS Error: Permission denied, errno = 13)

这是我的代码:

void download() async {
http.Response response = await http.post(url, headers: {"Accept": "application/json", HttpHeaders.authorizationHeader: 'Bearer}});

  File file = new File('/storage/emulated/0/Download/file.pdf');
  await file.writeAsBytes(response.bodyBytes);
}
Run Code Online (Sandbox Code Playgroud)

flutter

13
推荐指数
5
解决办法
2万
查看次数

标签 统计

flutter ×1