filename; //path to file as stored on server $path = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox/' . $work -> filename; //path to file as stored on server if (!Security::check_abs_path($path, api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox/')) { exit; } $file = $work->title; $result = DocumentManager::file_send_for_download($path, true, $file); if ($result === false) { api_not_allowed(true); } exit; } //@todo clean this file the code below is useless there are 2 exits in previous conditions ... maybe a bad copy/paste/merge? exit;