简体   繁体   中英

Get SWF file information using PHP (or javascript)

For one of my projects I would like to use PHP to read an SWF file on the server and get the dimensions of the stage of the SWF. So, the SWF file is not yet embedded in the page. Does anybody know if this is possible and which route I should take?

使用getimagesize() ,可以完美地处理swf文件。

See this (SWF Header Parser Class - licensed under LGPL):

http://www.phpclasses.org/browse/package/1653.html

The website says this:

This class is meant to parse the header of Shockwave Flash animation files (.swf) to extract metadata information like the width and height of animation, compression status and uncompressed size, frame rate and total number of frames.

This class parses Flash files using only PHP code, so no special extension is necessary.

Supports both, compressed and uncompressed SWF Flash movies

For those looking for a solution to getimagesize() on .SWF files stored in the database, here is a blob-data-as-file-stream wrapper I wrote. Tested on PHP 5.3.10.

http://pastebin.com/6uriJMZv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM