if ($proceed) { if (!$email['has_attachments']) { redirect('admin/emails_view.php?message_id=' . urlencode($message_id)); } } if ($proceed) { $attachments = email__dbstring_to_attachment_array($email['attachment_data'], false); if (!isset($attachments[$k])) { redirect('admin/emails_view.php?message_id=' . urlencode($message_id)); } } if ($proceed) { // mime type $mime_type = $attachments[$k]['mimetype']; if (!$mime_type || $mime_type == 'application/x-download') { $mime_type = downloads__mime_type(pathinfo($attachments[$k]['filename'], PATHINFO_EXTENSION)); } if (!$mime_type) { $mime_type = "text/*"; } $filename = str_replace(" ", "_", $attachments[$k]['filename']); ob_end_clean(); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: " . $mime_type . "; name=\"{$filename}\""); header("Content-Disposition: attachment; filename=\"{$filename}\""); header("Content-Description: File Transfer"); $data = $attachments[$k]['data']; echo $data; }
if ($experiment_id > 0) { $experimenters = db_string_to_id_array($experiment['experimenter']); if (!(in_array($expadmindata['admin_id'], $experimenters) && check_allow('file_download_experiment_my') || check_allow('file_download_experiment_all'))) { redirect('admin/experiment_show.php?experiment_id=' . $experiment_id); } } else { $allow = check_allow('file_download_general', 'download_main.php'); } } if ($proceed) { // load file specification $filedata = orsee_db_load_array("uploads_data", $upload_id, "upload_id"); // mime type $mime_type = $upload['upload_mimetype']; if (!$mime_type) { $mime_type = downloads__mime_type($upload['upload_suffix']); } if (!$mime_type) { $mime_type = "text/*"; } $filename = str_replace(" ", "_", $upload['upload_name']) . "." . $upload['upload_suffix']; ob_end_clean(); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: " . $mime_type . "; name=\"{$filename}\""); header("Content-Disposition: attachment; filename=\"{$filename}\""); header("Content-Description: File Transfer"); $data = base64_decode($filedata['upload_data']); echo $data; }