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 f0ca568f..e448d981 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -1009,7 +1009,7 @@ exports.CoreIoApi = Montage.create(Component, {
1009 * check if the file exists 1009 * check if the file exists
1010 */ 1010 */
1011 checkFileExists:{ 1011 checkFileExists:{
1012 value: function(fileUri, folderUri, fileType){ 1012 value: function(fileName, folderUri, fileType){
1013 var uri = "", response=null, status=true; 1013 var uri = "", response=null, status=true;
1014 1014
1015 //prepare absolute uri 1015 //prepare absolute uri
@@ -1017,9 +1017,11 @@ exports.CoreIoApi = Montage.create(Component, {
1017 folderUri = folderUri + "/"; 1017 folderUri = folderUri + "/";
1018 } 1018 }
1019 1019
1020 //todo:add file extension check if fileType present 1020 if(!!fileType && (fileName.lastIndexOf(fileType) !== (fileName.length - fileType.length))){
1021 fileName = fileName+fileType;
1022 }
1021 1023
1022 uri = ""+folderUri+fileUri; 1024 uri = ""+folderUri+fileName;
1023 1025
1024 response = this.fileExists({"uri":uri}); 1026 response = this.fileExists({"uri":uri});
1025 if(!!response && response.success && (response.status === 204)){ 1027 if(!!response && response.success && (response.status === 204)){