简体   繁体   中英

Cordova Write To WWW Directory (iOS)

I am trying to write a file to a directory within the WWW directory of my Cordova app.

Here is the situation:

  1. My program saves an image to the temporary directory

  2. I want the program to move the image from the temporary directory to the WWW directory, so that the file does not get deleted every time the app is initialized.

Is this possible?

Thanks.

No that's not possible. The WWW is sandboxed and therefore, you can't write anything inside of this folder. If you want to save a file you need to use the DOCUMENTS path and rely on the Cordova file plugin (PERSISTENT is the keyword)

https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md

You can also check the folder permissions here: https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md#ios-file-system-layout

As you can see, www is read-only (not r/w)

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