Answer the question
In order to leave comments, you need to log in
How to read pdf from S3 using Laravel?
So
$patch=Storage::disk('s3')->temporaryUrl($patch, now()->addMinutes(15));
return response()->file($patch);
Answer the question
In order to leave comments, you need to log in
$content = Storage::disk('s3')->get($path);
$header = [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="'.$file->name.'"'
];
return Response::make($content, 200, $header);
There are several options:
- make a public bucket or the object itself
- create a one-time iam policy and / or sts token (I don’t remember exactly)
- make a signed url in cloudfront
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question