Commit 1fc714c7 authored by Paarth's avatar Paarth

added backend delete functionality

parent c1486faa
<?php
include_once("database.php");
$postData = file_get_contents("php://input");
if (isset($postData) && !empty($postData)) {
$request = json_decode($postData);
$username = trim($request->username);
$data = trim($request->text);
$filename = trim($request->filename);
$lang = trim($request->language);
$path = '../users/' . $username . '/' . trim($request->path) . '/' . $filename . $lang;
if (unlink($path)) {
$msg = "file successfully deleted";
clearstatcache();
echo json_encode($msg);
}
else {
http_response_code(404);
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment