public function download($path, $removeDownloadedFile = false)
    {
        if(!file_exists($path)) {
            throw new Exception("File [ $path ] not found.");
        }

        $filename = pathinfo($path, PATHINFO_BASENAME );

        header("Content-Description: File Transfer");
        header("Content-Type: application/octet-stream");
        header("Content-Disposition: attachment; filename=\"$filename\"");

        @readfile($path);

        if($removeDownloadedFile) {
            @unlink($path);
        }
    }