const document = new picker.DocumentSaveOptions();
document.pickerMode = picker.DocumentPickerMode.DOWNLOAD;
let result = await new picker.DocumentViewPicker().save(document);
for (const dir of result) {
let filepath = dir + "/logo.zip";
log("writeFile", filepath, ab.byteLength)
let file = await fs.open(filepath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE | fs.OpenMode.TRUNC)
await fs.write(file.fd, ab).finally(() => fs.close(file))
}
打印出了
writeFile file://docs/storage/Users/currentUser/Download/xxx/xxx.png 1544648
随后写入文件报错
{"code":13900001}
尝试在SaveButton和DownloadFileButton的onClick回调中写入都报这个错误。
保存沙箱下文件到公共目录参考示例: