Skip to content
Snippets Groups Projects
Commit 4fd0514f authored by Georg Ehrke's avatar Georg Ehrke
Browse files

don't move file into subdirectory if a file with the same name already exists (fixes #92)

parent be215a09
No related branches found
No related tags found
Loading
......@@ -12,6 +12,11 @@ $file = stripslashes($_GET["file"]);
$target = stripslashes(urldecode($_GET["target"]));
if(OC_Filesystem::file_exists($target . '/' . $file)){
OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" )));
exit;
}
if(OC_Files::move($dir, $file, $target, $file)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
} else {
......
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