php中实现在线预览pdf文件功能
2020-06-15 15:19:54
php中实现在线预览pdf文件功能:
<?php
$file = 'http://'.$_GET["url"];
$filename = 'filename.pdf';
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
@readfile($file);
?>
<?php
$file = 'http://'.$_GET["url"];
$filename = 'filename.pdf';
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
@readfile($file);
?>