array( "message" => "Empty Filename" ))); exit(); } if(OC_Files::newFile($dir, $filename, 'file')) { if($content){ OC_Filesystem::file_put_contents($dir.'/'.$filename,$content); } OC_JSON::success(array("data" => array('content'=>$content))); exit(); } OC_JSON::error(array("data" => array( "message" => "Error when creating the file" )));