Skip to content
Snippets Groups Projects
Commit 654387ff authored by Robin Appelman's avatar Robin Appelman
Browse files

Show error when trying to create a file or folder that already exists

parent 336f21f0
No related branches found
No related tags found
No related merge requests found
......@@ -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]){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment