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

only emit the filesystem hooks once when creating a new file

parent 4a7591d0
No related merge requests found
......@@ -32,15 +32,16 @@ if($source){
OCP\JSON::error(array("data" => array( "message" => "Error while downloading ".$source. ' to '.$target )));
exit();
}
}
if(OC_Files::newFile($dir, $filename, 'file')) {
}else{
if($content){
OC_Filesystem::file_put_contents($dir.'/'.$filename,$content);
if(OC_Filesystem::file_put_contents($dir.'/'.$filename,$content)){
OCP\JSON::success(array("data" => array('content'=>$content)));
exit();
}
}elseif(OC_Files::newFile($dir, $filename, 'file')){
OCP\JSON::success(array("data" => array('content'=>$content)));
exit();
}
OCP\JSON::success(array("data" => array('content'=>$content)));
exit();
}
......
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