Software Archive
Read-only legacy content

cordova - save file into app sandbox

Giovanni_S_
Beginner
685 Views

Hi,

I' would like to save files into the app sandbox using Cordova Api.

I tried to use:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){ gotFS(fileSystem}, fail); 

 

function gotFS(fileSystem)

{

var entry=fileSystem.root;

}

But I discovered the "entry" variable points to public External Storage in Android, possible? where does the error came up?

And in iOS environment how i can save files persistently in app sandbox?

Thanks in advance!

 

 

 

0 Kudos
4 Replies
Elroy_A_Intel
Employee
685 Views

I recommend that you consider the plugin-based storage options recommended by Apache Cordova at https://cordova.apache.org/docs/en/latest/cordova/storage/storage.html#plugin-based-options.

0 Kudos
Giovanni_S_
Beginner
685 Views

Hi Elroy,
thanks for your reply,
i looked at the link you suggested me, but it seems to be useful for saving data into DB, not files.
My goal is to persistently save files into the app sandbox.

Is there any possibility?

Thanks

0 Kudos
Thomas_B_6
New Contributor I
684 Views

 

Hi Elroy,

hjust use the Sqlite Plugin, if you want to store data into a database.

Well documented and works well with the XDK.

Best

Tom

0 Kudos
Elroy_A_Intel
Employee
684 Views

I agree SQLite is a good database storage option for locally storing data in your app for persistence.

0 Kudos
Reply