diff options
Diffstat (limited to 'apps/files/ajax/delete.php')
-rw-r--r-- | apps/files/ajax/delete.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php new file mode 100644 index 00000000000..d8a01d7acf1 --- /dev/null +++ b/apps/files/ajax/delete.php @@ -0,0 +1,29 @@ +<?php + +// Init owncloud + + +OC_JSON::checkLoggedIn(); + +// Get data +$dir = stripslashes($_GET["dir"]); +$files = isset($_GET["file"]) ? stripslashes($_GET["file"]) : stripslashes($_GET["files"]); + +$files = explode(';', $files); +$filesWithError = ''; +$success = true; +//Now delete +foreach($files as $file) { + if( !OC_Files::delete( $dir, $file )){ + $filesWithError .= $file . "\n"; + $success = false; + } +} + +if($success) { + OC_JSON::success(array("data" => array( "dir" => $dir, "files" => $files ))); +} else { + OC_JSON::error(array("data" => array( "message" => "Could not delete:\n" . $filesWithError ))); +} + +?> |