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.

并且所有文件都将下载,而不是在浏览器中显示。

更多相关文章

  1. UpdateResource(增加、删除或替代某可执行文件中的资源)
  2. golang写服务端程序,作为文件上传与下载的服务器。配合HTML5以网
  3. HTML5新特性之文件和二进制数据的…
  4. 我正在尝试使用带有post方法的AJAX将用户名和密码发送到php文件
  5. 在Makefile.am中添加make install 的安装文件
  6. 在CSDN下载资源,扣了积分,下载的是一个404页面的html文件
  7. 如何在离子框架中显示图像标题?
  8. html5结合flash实现视频文件在所有主流浏览器兼容播放
  9. iis aspx常见错误 HTTP 错误 404 - 文件或目录未找到。

随机推荐

  1. pl/sql数据插入出现中文乱码问题
  2. 如何将行转换为列
  3. SQLyog Enterprise强制Copy表结构给本身
  4. Groovy Sql获取所有列
  5. 在PreparedStatement中重用参数?
  6. 水晶报表性能优化之道
  7. 【mysql】添加对emoji的支持
  8. 程序中处理一对多的数据
  9. 如何在sql server中生成并手动插入一个惟
  10. 使用 Servlet+jQuery+MySQL 实现简单的聊