public static function openApplicationFile($filename, $appsID) { $file_info = SJB_UploadFileManager::getMimeTypeAppsByFilename($filename, $appsID); if ($file_info) { $file_link = SJB_UploadFileManager::getUploadedFileLink($file_info['id'], false, true); for ($i = 0; $i < ob_get_level(); $i++) { ob_end_clean(); } header("Content-Length:" . filesize($file_link)); header('Content-Disposition: attachment; filename="' . $filename . '"'); header("Content-type: " . $file_info['mime_type']); readfile($file_link); exit; } return false; }