1
我有以下代碼到數據庫上傳到雲鈦:Appcelerator 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)));
}
});
但是,如果數據庫保存不止一次,它上傳另一個副本旁邊的舊的副本。我只想在雲上備份我的數據庫的一個副本。我知道有Cloud.Files.remove
和Cloud.Files.update
這兩種方法,我想用其中的一種方法爲我的數據庫的每個用戶在雲上保留一份副本。但是,它們的值爲file_id
。這個價值是什麼?它應該是什麼?
那麼,我將如何做到這一點?我嘗試使第一個參數爲空,並嘗試使用'where:{name:dbName}',但儘管文件不存在,查詢仍會成功返回,並且出現錯誤「Invalid file_id」。 –