语言

Menu
Sites
Language
tizen download api: not compatible with w3c file api?

requestFileSystem = window.requestFileSystem || webkitRequestFileSystem;
requestFileSystem(PERSISTENT, 0, gotFS, fail);

function gotFS(fileSystem) {
        var entry = fileSystem.root;
        entry.getDirectory("myDir", { create: true, exclusive: false }, gotDir, fail);
    }

function gotDir(dirEntry) {
    var downloadRequest = new tizen.DownloadRequest(url, dirEntry.fullPath, filename);
}

This does not work: UnknownError: Platform error while setting destination. Unknown error

In my current opinion, it *should* work this way. I know you can download using tizen.filesystem which is my current solution, but this makes files browsable and deletable through the file explorer - plus the files dont get deleted if you delete the app from the device.
 

 

响应

2 回复
Marco Buettner

You can not write to root

Thomas Uher

I know and I do not want to. You can create directories like shown in my example with the w3c filesystem api (this is different from the tizen filesystem api which tagets folders like /images, /documents etc) - and they are not created in root (of course). You also can write files to those directories  using the w3c file api - but not download files into it using the tizen api.