Answers for "laravel download image from s3"

PHP
0

store image to s3 laravel

// Products controller
use Illuminate\Support\Facades\Storage;

$image = $request->file('image');
$filePath = 'images/' . $image->getClientOriginalName();
Storage::disk('s3')->put($filePath, file_get_contents($image), 'public');
Posted by: Guest on May-11-2021
0

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);
Posted by: Guest on October-21-2020

Code answers related to "laravel download image from s3"

Browse Popular Code Answers by Language