PHP:打开服务器上的文件下载? [英] PHP: Open a file on the server for download?

查看:302
本文介绍了PHP:打开服务器上的文件下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上有一个PDF。现在我想打开这个文件,以便用户可以使用浏览器进行下载。我怎样才能做到这一点?我不想阅读文件或任何东西,它已经在服务器上,只需要下载...



谢谢?

解决方案

请具体来说,您的服务器是否是Web服务器?如果是这样,您可以简单地将pdf添加到您的根目录中的某个位置,并直接在Web浏览器中导航,并自动下载。



ie http://whateveryoursiteis.com/testpdf.pdf


I have a PDF on my server. Now I want to open this file so the user can download it using the browser. How can I do that? I dont want to read the file or anything, its already on the server, just need to download it ...

Thanks?

解决方案

Please be more specific, is your server a web server? If so, you can simply add the pdf somewhere in your root directory and navigate to it directly in a web browser and it should automatically download.

ie http://whateveryoursiteis.com/testpdf.pdf

这篇关于PHP:打开服务器上的文件下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆