/** * Download a specific attachment. * * @param \AbuseIO\Models\Evidence $evidence * @param string $filename [description] * * @return \Illuminate\Http\Response */ public function attachment(Evidence $evidence, $filename) { if ($attachment = $evidence->getAttachment($filename)) { return response($attachment->getContent(), 200)->header('Content-Type', $attachment->getContentType())->header('Content-Transfer-Encoding', 'Binary')->header('Content-Disposition', "attachment; filename=\"{$filename}\""); } else { return abort(404); } }