I need to do this thing pretty soon for my new project.
I still don't get this instruction.
Specially how to "SPIT out" image from DB and while() part.

Can you give us more detailed explanation?

Thanks

Andy


-----Original Message-----
From: Kee Hinckley [mailto:nazgul@;somewhere.com]
Sent: Monday, November 04, 2002 9:43 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Display Blob from database


At 9:34 AM -0800 11/4/02, Gerardo Schimpf wrote:
>Hello embperl fans!. I have a mysql table with a blob data type column and
>pictures stores in that column. How can I upload a picture and insert it
into
>that column and display the picture on a HTML page?

Uploading the picture you can do using test/html/upload.htm as an example.
Read the file in, stuff the bits in the database.
Displaying is a two part process.  The HTML page should have a reference
like:
        <img src="/foo.html?imageid=xxx">
and foo.html should consist of nothing except embperl code, like so:
[-
        $http_headers_out{'Content-Type'} = 'image/xxx';
        $http_headers_out{'Content-Length'} = yyy;
        spit out image data from database
        while (...) { print OUT xxx; }
        Apache::exit();
-]

You probably don't need the exit, I just do it to make sure no more
data ends up on the output stream.
--

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to