I currently have a system that allows the upload of Flash files to be embedded in dynamic webpages.

Now comes the hard part. I need to extract enough info out of the files to be able to generate the appropriate embedded object in the HTML.

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase= +"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0 +" ID=test WIDTH=270 HEIGHT=250> <PARAM NAME=movie VALUE="/flash/welcome3.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=salign VALUE=RB> <PARAM NAME=bgcolor VALUE=#cccccc> <EMBED src="/flash/welcome3.swf" menu=false quality=high salig +n=RB align="center" bgcolor=#cccccc WIDTH=270 HEIGHT=250 TYPE="appli +cation/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shoc +kwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> </OBJECT>
The important parts are the width and height but I would also like to be able to verify the version used (to stop uploading of Flash 6 files) and whether the file is actually a valid Flash file.

I have looked at CPAN with no luck. Perl::Flash and Flash::SWF handle flash but these seem to be based on version 3 or 4 and have not been updated for ages.

Does anyone know how to do this?

Thanks in advance
UnderMine


In reply to Extracting info from SWF Files by UnderMine

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.