Cordova写入WWW目录(iOS) [英] Cordova Write To WWW Directory (iOS)

查看:307
本文介绍了Cordova写入WWW目录(iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将文件写入我的Cordova应用程序的 WWW 目录中的目录。

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

情况如下:


  1. 我的程序将图像保存到临时目录

  1. My program saves an image to the temporary directory

我希望程序将图像从临时目录移动到 WWW 目录,这样每次应用程序都不会删除该文件初始化。

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.

这可能吗?

谢谢。

推荐答案

不,这是不可能的。 WWW是沙盒,因此,您无法在此文件夹中写入任何内容。如果要保存文件,则需要使用DOCUMENTS路径并依赖Cordova文件插件(PERSISTENT是关键字)

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

您还可以在此处检查文件夹权限:
https://github.com/apache/cordova-plugin-file/blob/master /doc/index.md#ios-file-system-layout

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

如您所见,www是只读的(不是r / w)

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

这篇关于Cordova写入WWW目录(iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆