query($sql_q); $file_d = $file_q->fetch_assoc(); if ($file_q->num_rows > 0) { $file_loc = REPOBS.str_ireplace('/', DS, $file_d['file_dir']).DS.$file_d['file_name']; if (file_exists($file_loc)) { if ($file_d['access_limit']) { if (utility::isMemberLogin()) { $allowed_mem_types = @unserialize($file_d['access_limit']); if (!in_array($_SESSION['m_member_type_id'], $allowed_mem_types)) { header("location:index.php"); continue; } } else { header("location:index.php"); continue; } } header("Content-Description: File Transfer"); header('Content-Disposition: attachment; filename="'.basename($file_loc).'"'); header('Content-Type: '.$file_d['mime_type']); readfile($file_loc); exit(); } else { die('