简体   繁体   中英

Can I create a folder in www directory via phonegap/cordova in IOS?

I want to download some static webpage files(including .html/.css/.js/.png...) from server into my cordova based app, then users can browse them in webview. So I need to create folders in www/ directory, how can I achieve it?

Yes, you can. You can use window.requestFileSystem to obtain a reference to the local filesystem (which is the application data folder).

Here is the documentation page: http://docs.phonegap.com/en/3.0.0/cordova_file_file.md.html#LocalFileSystem

Example functions would be:

  • directory.getFile
  • filewriter.write(...)

You then can create directories in there as well. Like this for example:

fileSystem.getDirectory(dirName, {create:true}) 

etc. etc. ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM