= $file_mtime) ) { http_response_code(304); exit; } // Audit log - skip thumbnail loads, and a picture in the ticket's text, which opening the ticket shows (functions/ticket_pictures.php) if (!$thumb && !ticketAttachmentIsPicture($row)) { logAudit("Ticket", "Download", "$session_name viewed ticket attachment $attachment_name_escaped", $client_id); } // Send the file header("Content-Type: $attachment_mime_type"); header("Content-Disposition: $disposition; filename=\"$safe_attachment_name\""); header("Content-Length: " . filesize($file_path)); header("X-Content-Type-Options: nosniff"); // Clear output buffers so large files stream instead of loading into memory while (ob_get_level()) { ob_end_clean(); } readfile($file_path); exit;