jeudi 6 septembre 2018

Laravel 5 set file name and title page when view pdf file in browser

I need view a pdf file in browser - which store in my Storage. But I can not set the page title by file name, it display a name what I don't know where it from. Can someone help me?

enter image description here

here is my code

$folderName = config('filesystems.folder_test');
$fileName = $file->name;

$file = Storage::disk('s3')->get($folderName . "/" . $fileName);

$response = Response::make($file, 200);
$response->header('Content-Type', 'application/pdf');
$response->header('Content-Disposition', 'inline; filename="'.$fileName.'"');

return $response;



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire