You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

寻求基于FileSystem API的多文件批量下载JS库(适配Chromium)

多文件批量下载功能需求与疑问

我正在开发一个浏览器端纯HTML+JS画廊,需要实现无需客户端/服务端压缩的多文件批量下载功能。经调研,搭配FileSystemDirectoryHandle与window.showDirectoryPicker的FileSystem API可以满足需求——它允许用户选择目录并直接在其中创建文件,示例代码如下:

async function storeFileInDirectory() {
    const dirHandle = await window.showDirectoryPicker(dirPickOpts);
    const testFile = await dirHandle.getFileHandle("test.txt", {create: true});
    const writable = await testFile.createWritable();

    // Write the contents of the file to the stream.
    await writable.write("Test content.");
    
    // Close the file and write the contents to disk.
    await writable.close();
}

但我没找到实现该功能的现成库,想请教:是否存在可注册Worker、在后台下载文件列表并保存至磁盘(最好支持断点续传)的此类库?目前我找到的最优实现是Stack Overflow上的一份原型代码。

备注:我知晓window.showDirectoryPicker在Firefox 120中无法使用,本功能仅需支持Chromium浏览器即可。

内容的提问来源于stack exchange,提问作者arch

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 12:24:58