Commit fb5735d8 authored by Eric Seigne's avatar Eric Seigne
Browse files

ios on essaye de passer sur le stockage Library persistant

parent 7a8f5b0f
......@@ -8,7 +8,7 @@
*************************************** */
function readFromFile(fileName, formdata, subject) {
// myDebug('readFromFile (1) : ' + fileName);
var pathToFile = window.cordova.file.dataDirectory + fileName;
var pathToFile = cordova.file.documentsDirectory + fileName;
window.resolveLocalFileSystemURL(fileName, function (fileEntry) {
// myDebug("readFromFile (2): " + JSON.stringify(fileEntry));
fileEntry.file(function (file) {
......@@ -32,7 +32,7 @@ function readFromFile(fileName, formdata, subject) {
var today = new Date();
var destFilename = today.getFullYear().toString() + ('0' + (today.getMonth() + 1)).slice(-2) + ('0' + today.getDate()).slice(-2) + "_"
+ today.getHours().toString() + today.getMinutes().toString() + "-" + subject + "-" + basename(fileName);
var newFileUri = window.cordova.file.dataDirectory;
var newFileUri = cordova.file.documentsDirectory;
// myDebug('Sauvegarde de la photo dans (1): ' + newFileUri);
// myDebug('Sauvegarde de la photo dans (2): ' + destFilename);
moveFile(fileName, destFilename);
......
......@@ -201,7 +201,7 @@ function moveFile(fileUri, newFileName) {
newFileUri = window.cordova.file.externalDataDirectory;
}
else {
newFileUri = window.cordova.file.dataDirectory;
newFileUri = cordova.file.documentsDirectory;
}
oldFileUri = fileUri;
window.resolveLocalFileSystemURL(newFileUri,
......
......@@ -48,7 +48,7 @@ function rSyncOne(idToSync) {
}
}
let pathToFile = window.cordova.file.dataDirectory;
let pathToFile = cordova.file.documentsDirectory;
if (window.cordova.platformId == "android") {
pathToFile = window.cordova.file.externalDataDirectory; //.replace("file://","");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment