Flutter Unzip文件夹为空(Flutter_archive 4.2.0)
在以下代码中,我选择了设备下载文件夹中的filepicker的zip文件,我说提取点将是同一文件夹,但是当我选择文件并执行提取过程时,日志中的所有内容看起来都很完美,但是当我访问创建的目录时,它说它是空的。我附上代码:
FilePickerResult? result = await FilePicker.platform.pickFiles();
if (result != null) {
final zip = File(result.files.single.path.toString());
final unZip = Directory("/storage/emulated/0/Download");
print(unZip.path.toString());
print(zip);
try{
ZipFile.extractToDirectory(zipFile: zip, destinationDir: unZip);
}catch(e){
print(e);
}
这些是我在AndroidManifest中分配的权限:
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
In the following code I select a zip file with filePicker that is in the downloads folder of the device, I say that the extraction point will be the same folder but when I select the file and perform the extraction process, everything in the log looks perfect, but when I access the created directory it says that it is empty. I attach the code:
FilePickerResult? result = await FilePicker.platform.pickFiles();
if (result != null) {
final zip = File(result.files.single.path.toString());
final unZip = Directory("/storage/emulated/0/Download");
print(unZip.path.toString());
print(zip);
try{
ZipFile.extractToDirectory(zipFile: zip, destinationDir: unZip);
}catch(e){
print(e);
}
These are the permissions that I have assigned in my AndroidManifest:
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用它
而不是这个
Try using this
instead of this