文件创建时的Chrome App SecurityError

时间:2014-12-30 23:03:59

标签: javascript google-chrome-app html5-filesystem

我有以下代码:

chrome.runtime.getPackageDirectoryEntry(function(directoryEntry) 
{
    directoryEntry.getFile("files/test.txt", {create: true, exclusive: false}, function(fileEntry) 
    {
        console.log(fileEntry);
    },
    function(error)
    {
        console.log(error);
    });
});

如果文件不存在且create为true,则会出现It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.错误。但如果确实存在并且create为false,则可以访问该文件。

我做错了什么?

0 个答案:

没有答案