gpt4 book ai didi

javascript - Windows 应用商店应用程序 javascript filesavepicker

转载 作者:行者123 更新时间:2023-11-28 08:20:10 25 4
gpt4 key购买 nike

努力使用文件保存选择器。我希望我的 savepicker 保存文件,我用 openpicker 打开并编辑它们。但是当我保存时,我通过 Savepicker 收到一个空的 0 字节文件。我可以使用本地存储保存该文件,该文件会自动保存在我指定的图片文件夹中。但对于 filesavepicker 则不然。请指导我如何使用 filesavepicker 保存图像文件。

savePicker.fileTypeChoices.insert("JPEG file", [".jpg"]);

最佳答案

我将它与我的文件保存选择器一起使用并得到空的 0 字节。
FileSavePicker.PickSaveFileAsync | FileSavePicker.PickSaveFileAsync | pickSaveFileAsync 方法
此处未添加完整代码。

fileSavePicker.pickSaveFileAsync().done( /* Your success and error handlers */ );  

我得到 0kb 字节的原因。引用msdn底部。

When the call to this method completes successfully, it returns a storageFile object that was created to represent the saved file. The file name, extension, and location of this storageFile match those specified by the user, but the file has no content.

To save the content of the file, your app must write the content to this storageFile.

关于javascript - Windows 应用商店应用程序 javascript filesavepicker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23081579/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com