From 9b26cb0bfb6c6b3aab03eb3320a9a9917786f1ac Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sun, 17 Apr 2011 17:49:56 +0200 Subject: implement "new folder" function --- files/ajax/newfolder.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 files/ajax/newfolder.php (limited to 'files/ajax/newfolder.php') diff --git a/files/ajax/newfolder.php b/files/ajax/newfolder.php new file mode 100644 index 00000000000..988e7f04012 --- /dev/null +++ b/files/ajax/newfolder.php @@ -0,0 +1,29 @@ + "error", "data" => array( "message" => "Authentication error" ))); + exit(); +} + +// Get the params +$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; +$foldername = isset( $_GET['foldername'] ) ? $_GET['foldername'] : ''; + +if($foldername == '') { + echo json_encode( array( "status" => "error", "data" => array( "message" => "Empty Foldername" ))); + exit(); +} +error_log('try to create ' . $foldername . ' in ' . $dir); +if(OC_FILES::newFile($dir, $foldername, 'dir')) { + echo json_encode( array( "status" => "success", "data" => array())); + exit(); +} + +echo json_encode( array( "status" => "error", "data" => array( "message" => "Error when creating the folder" ))); \ No newline at end of file -- cgit v1.2.3