Save a file on the Cordova jQuery device without overwriting using File FileTransfer

0

I have an app with cordova and using File-Transfer plugin that downloads a file to the device. I want to save more files that are generated on the server with the same name but I do not want to write the file that already exists. The problem is that I am using the following. Any ideas?

var documentoDescargado = null;

function descargarDocumento(jsonMasImg) {
    documentoDescargado = jsonMasImg; // obtengo un objeto binario y
    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}

function gotFS(fileSystem) {  
    var nombreDoc = documentoDescargado.DocArchivoNombre;

    fileSystem.root.getFile(nombreDoc, {create: true, exclusive: false}, gotFileEntry, fail);
//Recuperar un archivo existente, o crearlo si no existe
}
    
asked by Juan Saa 24.07.2018 в 16:53
source

0 answers