Save the image to any directory in FILEAPI

Asked 2 years ago, Updated 2 years ago, 130 views

I am studying FILEAPI at Monaca, but sometimes I cannot implement it even if I look at the documents on the website.
https://docs.monaca.io/ja/reference/cordova_6.2/file/

In this document, I am studying how to save images from outside using "Save Existing Binary Files", but I cannot save them in Library/NoCloud/any folder.
If I use PERSISTENT, can I save anything other than root?

javascript monaca cordova filesystems

2022-09-30 17:30

1 Answers

The reason is hard to read from the question, but it can be achieved with the following code:

//cordova.file.dataDirectory is NoCloud (library-nosync) on iOS
window.resolveLocalFileSystemURL(cordova.file.dataDirectory,
  function(dirEntry){
    createFile(dirEntry, "hoge.png", true);
  }
);


2022-09-30 17:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.