aboutsummaryrefslogtreecommitdiff
path: root/js/io/system
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/system')
-rwxr-xr-xjs/io/system/coreioapi.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 99f46fd7..5379cbfc 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -1086,7 +1086,7 @@ exports.CoreIoApi = Montage.create(Component, {
1086 * check if the file exists 1086 * check if the file exists
1087 */ 1087 */
1088 checkFileExists:{ 1088 checkFileExists:{
1089 value: function(fileUri, folderUri, fileType){ 1089 value: function(fileName, folderUri, fileType){
1090 var uri = "", response=null, status=true; 1090 var uri = "", response=null, status=true;
1091 1091
1092 //prepare absolute uri 1092 //prepare absolute uri
@@ -1094,9 +1094,11 @@ exports.CoreIoApi = Montage.create(Component, {
1094 folderUri = folderUri + "/"; 1094 folderUri = folderUri + "/";
1095 } 1095 }
1096 1096
1097 //todo:add file extension check if fileType present 1097 if(!!fileType && (fileName.lastIndexOf(fileType) !== (fileName.length - fileType.length))){
1098 fileName = fileName+fileType;
1099 }
1098 1100
1099 uri = ""+folderUri+fileUri; 1101 uri = ""+folderUri+fileName;
1100 1102
1101 response = this.fileExists({"uri":uri}); 1103 response = this.fileExists({"uri":uri});
1102 if(!!response && response.success && (response.status === 204)){ 1104 if(!!response && response.success && (response.status === 204)){