diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/lib_files.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/js/lib_files.js b/js/lib_files.js index 8f7f9035585..54af643272a 100644 --- a/js/lib_files.js +++ b/js/lib_files.js @@ -225,6 +225,10 @@ OC_FILES.newFile=function(type,name,dir){ arg=new Object; arg.name=name; arg.dir=dir; + if(OC_FILES.cache.files[name]){//check if the file already exists + alert(((type=='dir')?'folder ':'file ')+name+' already exists.'); + return; + } arg.type=type; OC_API.run('new',{dir:dir,name:name,type:type},OC_FILES.new_callback,arg) if(!OC_FILES.cache.incomplete[dir]){ |