这就是我现在所拥有的:
$file = $generation->pdfStoragePath().'/'.$downloaded_filename;
$headers = [
'Content-type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="' . $downloaded_filename . '"',
'Content-Transfer-Encoding' => 'binary',
'Accept-Ranges' => 'bytes',
];
return Response::download($file, $downloaded_filename, $headers);
问题是,每当我尝试打开获取文件的链接时,文件都会下载而不是在浏览器窗口中显示。正如您所看到的,我尝试在此博客后设置标题:http://yogeshchaugule.com/blog/2013/how-display-pdf-browser-php但没有成功。任何想法,问题在哪里?