I'm storing files in a database in 64K chunks, then retrieving them to serve them to the viewer. This involves giving the following headers:
Content-Type: video/x-ms-wmv Content-Length: FILESIZE HERE Content-Disposition: attachment; filename=FILENAME HERE
...then printing the contents of the file as they are retrieved from the database. It works just fine for -downloading- the file, but when I try to show it in a player:
<object type="video/x-ms-wmv" data="PATH TO SCRIPT / FILE" width="WIDT +H" height="HEIGHT"> <param name="src" value=""PATH TO SCRIPT / FILE"> <param name="autoStart" value="0"> <a href="PATH TO SCRIPT / FILE">Download File</a> </object>
It shows the player and then dies. I know the file serves correctly, since I can download it and play it locally, and I know the player works correctly, since if I FTP in the file and point to it directly rather than to my file serve script, it loads, so the error must be in how I'm doing my headers. Has anyone run into this problem, and is there an easy fix that doesn't involve storing the files in a directory rather than a database?

In reply to OT: Displaying Windows Media file from database? by TedPride

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.