Example 1 The code is as follows:Copy code Header ("Content-Type: text/html; charset = UTF-8 & Prime ;);Header ("Content-type: application/text ");// The file will be called downloaded.pdfHeader ("Content-Disposition: attachment; filename = log.
Example of IMAP application in Php (sending and receiving emails, deleting emails, and downloading attachments)
This article describes how to use IMAP in php to send and receive emails, delete emails, and download attachments. For more
Microsoft has an article: HTTP://SUPPORT.MICROSOFT.COM/KB/193998/ZH-CN, with Doc Read and display binary data, "How to read binary file", no test, lazy compiler DLL
ASP program:
Response.buffer=true
Response.contenttype= "Application/x-msexcel"
Dim
The browser determines how to display the returned message body Content based on Content-Type. The following describes the Content-type, that is, the Type of the HTTP request header, if you are interested in content-type, you must know in advance
Void header (string [, bool Replace [, inthttp_response_coDe])Void header (string [, bool Replace [, inthttp_response_coDe])
Header () is used to send httpheader. Replace is an optional parameter, indicating whether to replace a similar header in
The article is also very simple, we just use head to send header information can be implemented to download the file to this, there is a direct send header information also has to save the file on the server and then use the header to send Oh, there
Different contenttypes will affect the client's effect. The default ContentType is text/html, that is, the webpage format.The Code is as follows:
The original html code is displayed.
The following are some common contenttypes:GIF images
JPEG
Use Response. ContentType = "type name"; in ASP. NET to determine the output format
'Ez '=> 'application/andrew-inset ','Hqx' => 'application/mac-binhex40 ','Cpt' => 'application/mac-compactpro ','Doc' => 'application/msword ','Bin' => 'application/
Different contenttypes will affect the client's effect. The default contenttype is text/html, that is, the webpage format. Code For example: The original HTML code is displayed. The following are some common contenttypes:GIF images JPEG images
Php file download method. The article is also very simple. we only need to use the head to send the header information to download the file to the local file, directly sending header information, saving the file on the server, and then sending the
This allows you to download images as attachments. Please refer to the following program! This allows you to download images as attachments. Please refer to the following program!
// File directory define ('dl _ dir', 'temp /'); // MIME type
Summary of the phpheaderContent-Type. Copy the code as follows :? Php $ mimetypesarray (ezapplicationandrew-inset, hqxapplicationmac-binhex40, cptapplicationmac-compactpro, docapplicatio
The code is as follows:
$ Mimetypes = array ('EZ '=>
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.