public function deleteFile($id)
 {
     $f = new DBFile();
     $data = $this->fileFindById($id);
     if ($data != null) {
         $filename = $data[0]->url;
     }
     if ($f->delete($id)) {
         if (FileUtils::Delete($filename)) {
             return true;
         }
     }
     return false;
 }
<?php

require_once 'core/init.php';
if (Input::exists('post')) {
    $filepath = Input::get('filepath');
    if (isset($filepath)) {
        if (FileUtils::Delete($filepath)) {
            echo $filepath;
        }
    }
}