Parsing swf file header under PHP
Recently, in
CSDN
On the forum to see a post, want to implement PHP to get the SWF file frame number of functions, some users replied that it is impossible, in fact, they do not understand the SWF file format, SWF
Flash animation with Macromedia Flash friends know that after the completion of the production we can save the work into a FLA format file for future modification. When you want to publish on the Internet, export it as a SWF file. After the export
1. Download the conversion toolScratch2flash.zip Download: Join 366244662 (for kids programming enthusiasts); Download in group file2. Conversion:(1) Unpack the tarball and open scratchflash.html(2) Select the file to convertPoint:, I choose
File signatures are usually in the header of the file, and if you view the file in hexadecimal, you can see some signature information for the file. If you use Uestudio to view a zip-formatted file in 16, the file content header has 4 b 03 04 hex
Php code for file type detection based on file header information
// Check the file type
Function checkFileType ($ fileName ){
$ File = fopen ($ fileName, "rb ");
$ Bin = fread ($ file, 2); //
Detecting file types
function Checkfiletype ($fileName) {
$file = fopen ($fileName, "RB");
$bin = Fread ($file, 2); Read-only 2 bytes
Fclose ($file);
c is an unsigned integer, the net search is C, signed integer, this will
You don't have to have the patience to read everything: Brief installation instructions are as follows install http://sourceforge.net/projects/awstats/Download installation package: gnu/ Linux:tar zxf awstats-version.tgz awstats scripts and
1, Mime_content_type () function to judge get file type
Mime_content_type returns the MIME type of the specified file.
Usage:
The code is as follows
Copy Code
Echomime_content_type (' Php.gif '). " n ";Echomime_content_
PHP file type verification class function based on the file header. I wrote a verification class here to determine the file format through the file header. (It is not secure. if the user spoofs the file header, it can also pass verification.) copy
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.