Cordova's FileTransfer Writing Error (Code 1)

大兔子大兔子 提交于 2019-12-04 10:22:14

The problem was caused by an upgrade of Cordova from a previous version.

The path of local files was not properly identified: .fullPathis now obsolete and should be replaced by .toURL().

I think your problem is not with FileTransfer plugin, but the way you are trying to check if the file exists.

Looking here: http://www.html5rocks.com/en/tutorials/file/filesystem/ you we'll see that accessing to a file which its immediately parent does not exist raise an exception:

Inside the callback, we can call fs.root.getFile() with the name of the file to create. You can pass an absolute or relative path, but it must be valid. For instance, it is an error to attempt to create a file whose immediate parent does not exist.

I am wondering if the problem is that the parents of your file don't exist. In this case the folders .myapp and contentImages.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!