<?php include_once getcwd() . "/classes/BLCarFile.php"; include_once getcwd() . "/classes/BLBlobs.php"; $blCarFile = new BLCarFile(); $blBlobs = new BLBlobs(); if (isset($_GET["id"])) { $id = $_GET["id"]; $carfile = $blCarFile->getCarFile($id); $blCarFile->deleteCarFile($id); $blBlobs->deleteBlobs($carfile->getBlobId()); unlink(getcwd() . "/files/" . $carfile->getName() . "." . $carfile->getType()); }