How do I work with the local filesystem? | Aquro Help Center

When working with local file system it is important to remember that different platforms have different kinds of filesystems and there are different kinds of folders and permissions to keep in mind.

Therefore all file system related Visual Coding (VC) blocks in the Aquro platform have full support for cdv-file paths which resolve many of these issues automatically, so we strongly recommend that you use these types of file paths.

A cdv-file path is a specific formatted file path that will be resolved into a native file path automatically.

A cdv-file path looks like this:

cdvfile://localhost/fs-root/path/to/file

Where fs-root is one of the different file system roots that exists in a mobile device. Look at fs-root as a specified drive on your computer. If you are running windows you may have a c:, d:, e: and so on. The same applies on a mobile device, but here the different drives have very specific purposes.

However, for most usage you only have to care about using two different fs-roots.

For temporary files that does not need to be kept after the application closes use:

cdvfile://localhost/temporary/

For persistent files that needs to be saved over longer time (kept even when the application closes) use:

cdvfile://localhost/persistent/

Example

You are using the Device.File.Download block to download a file you would like to store in a folder you already created called MyFiles in the persistent storage.

The parameter SaveToPath to the manger should contain the directory where you like to download the file to.

The value you should use as the SaveToPath parameter in the block should then be:

cdvfile://localhost/persistent/MyFiles/



For more details about the working with local file system please view the Cordova File Plugin documentation.