Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel download file from s3

$attachment = TicketAttachment::find($id);
$headers = [
    'Content-Type'        => 'application/jpeg',
    'Content-Disposition' => 'attachment; filename="'. $attachment->name .'"',
];
return Response::make(Storage::disk('s3')->get($attachment->url), 200, $headers);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #download #file
ADD COMMENT
Topic
Name
6+3 =