aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2010-12-12 22:34:17 +0100
committerRobin Appelman <icewind1991@gmail.com>2010-12-12 22:34:17 +0100
commit654387ff05e84c51a4c85854abe1843bb65ed412 (patch)
treea3e3ae7c9b0511e92b334f3c87243daa526180d6 /js
parent336f21f0aa5d62ece5610528dc52e84f4f46f5f4 (diff)
downloadnextcloud-server-654387ff05e84c51a4c85854abe1843bb65ed412.tar.gz
nextcloud-server-654387ff05e84c51a4c85854abe1843bb65ed412.zip
Show error when trying to create a file or folder that already exists
fixes https://bugs.kde.org/show_bug.cgi?id=259616
Diffstat (limited to 'js')
-rw-r--r--js/lib_files.js4
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]){