在电子渲染过程中,我想获取一个W3C文件对象,它是一个本地路径文件,我该怎么办?

时间:2018-09-06 11:41:12

标签: javascript html5 file electron w3c

我的本​​地文件在/opt/local/testdir/test.txt

const requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem
const persistentStorage = navigator.persistentStorage || navigator.webkitPersistentStorage
const resolveLocalFileSystemURL = window.resolveLocalFileSystemURL || window.webkitResolveLocalFileSystemURL
const DEFAULT_MAX_SIZE = Number.MAX_SAFE_INTEGER
resolveLocalFileSystemURL(
    'filesystem:file:///persistent//opt/local/testdir/test.txt',
    entry => {
        debug('resolveLocalFileSystemURL entry: %O', entry)
    },
    err => debug('resolveLocalFileSystemURL %O', err),
)

发生以下错误

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.

我的目标是获取W3C File或FileList对象。

0 个答案:

没有答案