Php allows the browser to download pdf instead of open. This article introduces how to enable users to download a PDF file to the client instead of simply browsing the file in a browser. Some browsers have installed this article to show you how to
Sometimes, to hide the truth, we define the file as a header and then download the readfile, but this will increase the burden on the server. generally, we do not recommend downloading large files.
The code is as follows:
Function sendFile ($
This article describes how to allow a user to open a PDF file instead of simply browsing the browser, but directly downloading the PDF file to the computer.
This article describes how to allow a user to open a PDF file instead of simply browsing
This article describes how to allow users to open pdf files instead of directly browsing in the browser, but directly downloading the pdf file to a computer. Some browsers have installed the pdf open program and associate it with the browser,
Some browsers install the PDF opener associated to the browser, so the direct way to write the PDF path is to open the PDF instead of the download, below I say if let them just download, not browse.
Create a PHP file
Copy the Code code as
Use PHP to force Download PDF file examples. Sometimes, when we need to download a PDF file, if it is not processed, the PDF file will be opened directly in the browser, you can save the file by saving it as a file. if you need to download a PDF
This article describes how to allow users to open pdf files instead of directly browsing in the browser, but directly downloading the pdf file to a computer. some browsers have installed the pdf Open Program and associate it with the browser,
When you need to download a PDF file, if it is not processed, it will open the PDF file directly in the browser, and then you need to save it as a file to save the download, below we can use PHP to directly download PDF files. sometimes we encounter
This article introduces how to enable users to download a PDF file to the client instead of simply browsing the file in a browser.
Some browsers have installed pdf open programs associated with browsers, so when writing the pdf path directly, they
When you need to download a PDF file, if not processed directly in the browser to open the PDF file, and then need to save by saving the download file, the following through PHP to download the pdf file directly We sometimes encounter situations
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.