Skip to content

Commit

Permalink
slight change on how the attachments are fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcbrn committed May 6, 2021
1 parent 9b757a5 commit 1b37b7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/EmailLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public function fetchAttachment($id,$attachment)
$email = EmailLog::select('id','attachments')->find($id);
$attachmentFullPath = explode(', ',$email->attachments)[$attachment];

return Storage::get(urldecode($attachmentFullPath));
$file = Storage::get(urldecode($attachmentFullPath));
$mimeType = Storage::mimeType(urldecode($attachmentFullPath));

return response($file, 200)->header('Content-Type', $mimeType);
}

public function createEvent(Request $request)
Expand Down

0 comments on commit 1b37b7d

Please sign in to comment.