2012-09-22 42 views
1

嗨我必須從移動應用程序(html5,Phonegap)讀取一些文件。這是一個文件的路徑

如何將我的應用程序指向我的設備的根目錄。我用root的意思是我打開「我的文件」應用程序時看到的目錄?

回答

0

我想你要找的是什麼window.requestFileSystem

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

和:

fileSystem.root.getDirectory(window.appRootDirName, { 
     create : true, 
     exclusive : false 
    }, dirReady, fail); 

這個要點應該對你有所幫助:https://gist.github.com/2894564

相關問題