在新选项卡中打开下载的文件
16lz
2021-01-22
in my web page i used
在我使用的网页中
<meta http-equiv="Refresh" content="3;URL=<?php echo JURI::base(); ?>/images/uploads/<?php echo $filee;?> " target="_blank">
to download files. it works well but the PDF and image files are opening in the current tab. is there any way to make them open in new tab in the browser.
下载文件。它工作正常,但PDF和图像文件在当前选项卡中打开。是否有任何方法可以在浏览器的新选项卡中打开它们。
(I used header for making file download but since it is a force download it will not print some text before downloading. that is why I use meta for file download.)
(我使用标题进行文件下载,但由于它是强制下载,因此在下载之前不会打印一些文本。这就是我使用meta进行文件下载的原因。)
1 个解决方案
#1
0
You should also send header (when you are trying to download files):
您还应该发送标题(当您尝试下载文件时):
header ("Content-Disposition: attachment; filename=".$file);
And all files will download, not show in browser.
并且所有文件都将下载,而不是在浏览器中显示。
更多相关文章
- UpdateResource(增加、删除或替代某可执行文件中的资源)
- golang写服务端程序,作为文件上传与下载的服务器。配合HTML5以网
- HTML5新特性之文件和二进制数据的…
- 我正在尝试使用带有post方法的AJAX将用户名和密码发送到php文件
- 在Makefile.am中添加make install 的安装文件
- 在CSDN下载资源,扣了积分,下载的是一个404页面的html文件
- 如何在离子框架中显示图像标题?
- html5结合flash实现视频文件在所有主流浏览器兼容播放
- iis aspx常见错误 HTTP 错误 404 - 文件或目录未找到。