Need function that allows delete several files from users.
What API function can help me?
Need algorithm ...
if some interested of this ->
<?php
/**
* @author InQaaaa
* @copyright 2016
*/
require("config.php");
$userid = $_GET['userid'];
$filename = $_GET['filename'];
//Get id of file
$table = "files";
$select = "filename = '$filename' AND userid = '$userid' AND filearea='private'";
$result = $DB->get_records_select($table, $select);
//Some manipultaion with stdObject
$array = json_decode(json_encode($result), True);
$array1 = array_shift($array);
$idd = $array1["id"];
// Delete it if it exists
$file = $fs->get_file_by_id($idd);
if ($file) {
$file->delete();
}
?>