let's say I've got a file called foo.html
sitting (quite comfortable) in my assets/www directory (next to my index.html).
I'd like to copy that file to another location on the device. My first approach window.resolveLocalFileSystemURI("foo.html", cool(), notCool());
is not working. Also with a prefix like www/ it won't.
It would be interesting to know if it is actually possible at all to access files via Phonegap. I'm not convinced and therefore would like to see a code snippet how to obtain a FileEntry for files in the assets directory - if possible.
edit:
Ok now we've got a call like this
window.resolveLocalFileSystemURI("file:///android_asset",
function(entry){
console.log(entry.fullPath);},
function(evt){
console.log(evt.code);}
);
but we've get an error with code: undefined
(Phonegap v1.2) and code: 1
with v1.0 (code 1 = file not found?!)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…