<?php
    $targetfile = $_GET['name'];
    $targetfolder = $_GET['folder'];
    $filepath = APP_DIR."$targetfolder/".$targetfile."";
    $ret->path= $filepath;
    if(file_exists($filepath)){
        if(unlink($filepath)) {
            $ret->status="success";
            $ret->msg="Agent Removed!!";
        } else {
            $ret->status = "error";
            $ret->msg= "Error in removing user";
        }
    } else $ret->msg= "File not found";

    echo json_encode($ret);
?>
