<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<form enctype="multipart/form-data" action="" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="67108864" />
    SWF ファイルをアップロード: <input name="swffile" type="file" />
    <input type="submit" value="ファイルを送信" />
</form>
<?php

if (isset($argc) && ($argc 1)) {
    if (! 
is_array($_FILES)) {
        
$_FILES = array();
        
$_FILES['swffile'] = array();
    }
    
$_FILES['swffile']['tmp_name'] = $argv[1];
}
    
if (empty(
$_FILES['swffile']['tmp_name'])) {
    echo 
"ファイルを指定してください。(64MBytes 以内に限定してます)";
    exit(
0);
}

$filename $_FILES['swffile']['tmp_name'];
$swfdata file_get_contents($filename);
if (
$swfdata 67108864) {
    echo 
" 64M Bytes 以内のファイルしか受け付けません。";
    exit(
0);
}

$swf = new SWFEditor();
$swf->input($swfdata);

echo 
"<table border=1>\n";
echo 
"<th> tag </th> <th> length </th> <th> info </th>\n";
foreach (
$swf->getTagList() as $tag_seqno => $tagblock) {
    
$tag$tagblock['tag'];
    if (empty(
$tagblock['tagName'])) {
        
$name "Unknown";
    } else {
        
$name $tagblock['tagName'];
    }
    
$length $tagblock['length'];
    
$detail = @$tagblock['detail'];
    echo 
"<tr>\n";
    echo 
"<td> $name($tag) </td> ";
    echo 
"<td> $length </td>\n";
    if (
$detail) {
        
$detail_info print_r($swf->getTagDetail($tag_seqno), true);
        
$detail_info mb_convert_encoding($detail_info"UTF-8");
        echo 
"<td> $detail_info </td>";
    } else {
        echo 
"<td> - </td>";
    }
    echo 
"</tr>\n";
}
echo 
"</table>\n";

?>
</body>
</html>