I have the following code to upload a database to the Titanium Cloud:
Cloud.Files.create({
name : dbName,
file : dbFile
}, function(e) {
if (e.success) {
var file = e.files[0];
alert('Boats successfully backed up to cloud!');
} else {
alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
However, if the database is saved more than once, it uploads another copy alongside the old copy. I would only like to have a single copy of my database on the cloud. I know there are the methods Cloud.Files.remove
and Cloud.Files.update
, and I would like to use one of them to keep a single copy per user of my database on the cloud. However, they have a value known as file_id
. What is this value and what should it be?