window.requestFileSystem()函数的简单示例

abi*_*ash 4 javascript jquery google-chrome google-chrome-devtools

我有下一个问题:我尝试window.requestFileSystem()在Chrome中使用功能,但它失败了.寻找我的步骤:

1)我在Chrome中添加了"允许从文件访问文件"标志(请参阅img bellow):在此输入图像描述

2)我重新启动了系统.

3)然后我用'允许文件访问文件'标志运行Chrome.

4)毕竟我尝试启动此示例代码:

function onInitFs(fs) {
  console.log('Opened file system: ' + fs.name);
}

    function errorHandler(e)
{
    console.log("Error");
}    
    window.requestFileSystem(window.TEMPORARY, 5*1024*1024 /*5MB*/, onInitFs, errorHandler);
Run Code Online (Sandbox Code Playgroud)

但它失败了: 在此输入图像描述

我的行为有什么问题?

ndm*_*ndm 14

这是因为此功能目前仅可用于前缀,即 window.webkitRequestFileSystem

你可能会发现这个有趣的东西:http://www.html5rocks.com/en/tutorials/file/filesystem/