Why not download the. DOC file?-php Tutorial

Source: Internet
Author: User
How to not generate. to download the DOC file, extract the database content and download it. do not generate the DOC file on the server, you can only directly generate a file in the cache when you click it and download the generated file now. I have already done this. I just don't know how to directly click download without generating the file. ------ solution ---------------- In after the HEADER is configured, how to avoid using echo directly. provides the download of DOC files.
Now we need to use this function to extract the database content and download it to the. DOC file.
But do not generate files on the server. you can only generate and download files directly in the cache when clicking.

Now, I have generated and downloaded the file.

Just click to download without generating a file.



------ Solution --------------------
After HEADER configuration, directly use echo $ content
$ Content is the content you need. you can organize it first and click it to create it. this is the same as reading a file, but you do not need to generate a file.
------ Solution --------------------
[Code = php]
Header ("Content-type: application/msword ");
Echo "the variables in the document content are stored here ";
[/Code]

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.