List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:June 21 2000 7:14pm
Subject:Re: Storing BLOBs ??is it a faq?
View as plain text  
On Wed, Jun 21, 2000 at 05:31:12PM +0300, sinisa@stripped wrote:
> Instead of storing images in arrays, why don't you just shoot them out 
> one after another with WWW page ?? Just like in that C++ example ...
> 
> Then no memory will be consumed.

To clarify this point (or drive it home, whatever), when your program
prints out the image data, it can print *only* image data.  The
Content-type: header will be image/jpeg (or /png or whatever), and
you can't anything else.  So you will first print out HTML like this:

    <html>
    .
    .
    .
    <!-- you will have 8 of these, each with a different img_id -->
    <table border="0">
    <tr><td><img src="/your-script?img_id=12321" width="300" height="149"
         alt="You are stupid if you don't buy this item."></td></tr>
    <tr><td>This is the item's description.</td></tr>
    </table>
    .
    .
    .

Then, your script checks to see what the img_id is, and fetches *only
that one image* from the database and prints it immediately.  As soon
as it's done printing it, it quits - so it's not storing anything in
memory longer than it's needed.

Still, I would just store the images on disk and let the web server
worry about it.  Less work, and will probably be better.

Tim
-- 
Tim Smith   < tim@stripped >  :MySQL Development Team:  Boone, NC  USA.
Thread
Storing BLOBs ??is it a faq?Dr. Dieter Becker20 Jun
  • Re: Storing BLOBs ??is it a faq?sinisa20 Jun
    • RE: Storing BLOBs ??is it a faq?Dr. Dieter Becker20 Jun
      • RE: Storing BLOBs ??is it a faq?sinisa20 Jun
      • Re: Storing BLOBs ??is it a faq?Steve Ruby20 Jun
    • Re: Storing BLOBs ??is it a faq?Mark Lo20 Jun
      • Re: Storing BLOBs ??is it a faq?Masood Nasir20 Jun
      • Re: Storing BLOBs ??is it a faq?sinisa21 Jun
    • Re: Storing BLOBs ??is it a faq?Mark Lo21 Jun
      • Re: Storing BLOBs ??is it a faq?sinisa21 Jun
        • Re: Storing BLOBs ??is it a faq?Thimble Smith21 Jun
RE: Storing BLOBs ??is it a faq?Dennis Gearon20 Jun