pdf文件,可通过a标签直接预览,其写法是将pdf文件的url地址直接放在a标签的href属性即可。
<a href="pdf文件地址" target="_blank">预览pdf文件</a>
注意:想通过这样方式预览pdf文件,需要保证pdf上传的时候其文件类型content-type一定要设置为pdf格式(即content-type=“application/pdf”),不然点击链接的时候,不能正常预览文件,会弹出下载页面
pdf文件,可通过a标签直接预览,其写法是将pdf文件的url地址直接放在a标签的href属性即可。
<a href="pdf文件地址" target="_blank">预览pdf文件</a>
注意:想通过这样方式预览pdf文件,需要保证pdf上传的时候其文件类型content-type一定要设置为pdf格式(即content-type=“application/pdf”),不然点击链接的时候,不能正常预览文件,会弹出下载页面