PHP exactly gets the file MIME type method,
The example in this article describes how PHP gets the file MIME type exactly. Share to everyone for your reference. The implementation method is as follows:
' application/pdf ', ' xml ' = '
Introduction: This is a php file MIME table details page, describes and php, related knowledge, skills, experience, and some php source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 329780 'rolling =
This article mainly introduces how PHP obtains the file MIME type, the interest friend's reference, hoped to be helpful to everybody.
The example in this article describes how PHP gets the file MIME type exactly. The implementation method is as
how PHP Gets the file MIME type
1. Using the Mime_content_type method
String Mime_content_type (String $filename) Returns the MIME content type for a file as determined by using information f Rom the magic.mime file.
However, this method was
This article is after watching the http://blog.csdn.net/chaijunkun/article/details/7046343 practice a bit, for their own deepening the impression to write again.The jar package is downloaded with Firefox, where it is forgotten. When you write a file
The example in this article describes how PHP gets file MIME types. Share to everyone for your reference. Specifically as follows:
1. Using the Mime_content_type method
String Mime_content_type (String $filename)
Returns the MIME
The examples in this article describe how PHP accurately obtains file MIME types. Share to everyone for your reference. The implementation method is as follows:
' application/postscript ', ' eps ' => ' application/post Script ', ' exe ' => '
This article was reproduced from: http://hotsunshine.iteye.com/blog/857485Using Javax.activation.MimetypesFileTypeMapNeed to introduce Activation.jar this jar package, he can get http://java.sun.com/products/javabeans/glasgow/jaf.html from this
The example in this article describes how PHP accurately obtains file MIME types. Share to everyone for your reference. The implementation methods are as follows: ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27-
We know that there are often content-type headers in the HTTP request header, which is critical when Java uses post to make a request, and we can't ignore it. In the last few days of work, because I have been in contact with post upload files to
Mime_content_type: the MIME type of the specified object is returned,Usage: The code is as follows:Copy code Echo mime_content_type ('php.gif '). "n ";Echo mime_content_type ('test. Php '); Output:Image/gifText/plainHowever, this function will
Increase the MIME type of the BT seed so that the. torrent format can be downloaded, the extension is. torrent,mime type is application/octet-stream, extension, and so on know, is the type do not know, now record, lest again forget!
Now many
The solution is as follows, and the other frameworks are identical.
Source code (/system/libraries/upload.php 199 line)
$this->file_type = preg_replace ("/^" (. +?);. *$/"," \\1 ", $_files[$field] [' type ']);
Modified as follows:
Copy
This article mainly introduces php's method for accurately obtaining the object MIME type, and involves php's related techniques for file attribute operations, for more information about how to obtain the MIME type of a file, see the example in this
Note: I just wrote an article titled ihttphandler (2): anti-leech! My resources can only be downloaded by my users. The URL is http://blog.csdn.net/zhoufoxcn/archive/2008/01/11/2018.5.aspx. It is estimated that many friends are not familiar with the
What is the MIME type, which is the type of file that sets an extension to open with an application, and when the file is accessed, the browser automatically opens with the specified application.Used to specify some client-defined file names and how
PearMail sends an email with an attachment. It is easy to add one or more attachments by adding an attachment. you can call the addAttachment method multiple times to add multiple attachemets. Boolean add attachment
Add an attachment
It is easy to
This example describes how PHP obtains file types and file information. Share to everyone for your reference. The implementation methods are as follows:
";
echo "File size:". Round (FileSize ("$file")/1024,2). " Kb ";
echo "File size:".
& Amp; 65279; & amp; 65279; role: View file type information & amp; 26684; formula: FILE [OPTIONS] [file] main parameters: -- help displays the help information-v, -- version outputs the version information and exits-B. -- brief does not display the
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.