Your post is pretty hard to read. Please read writeup formatting tips.

Anyway, here's a reasonable start:

# .. get data from blob into $blob_field. print "Content-type: application/octet-stream\n"; # or use the right c +ontent-type for the field if you know it print "Content-disposition: attachment; filename=somefile.ext\n\n"; binmode STDOUT; print $blob_field;
I have no idea what LWP has to do with any of this, though.

update: ah it appears you want a "file-download field" in your form. There is no such thing as such in HTML. My code above will work fine if you link to it though - it will (or rather, should) cause the browser to open a "save as..." file selector and save the content to that file. You can only send one file per request this way, so your best bet is to create a list of links for each blob field. In other words, the script above should be called as a CGI for each field.


In reply to Re: downloading files from mySQL by Joost
in thread downloading files from mySQL by gmacfadden

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.