You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Maurice McCabe <mm...@orbsoft.com> on 2003/06/11 01:48:37 UTC
using embpcgi.pl & reading images from database
The following code works when called using mod_perl. It does not work when
calling via embpcgi.pl. Does anyone have a suggestion why?
[-
use DBI;
use ZIPLoc;
$dbh = DBI->connect("DBI:mysql:locator", "root", "") || die "Can't connect:
$_";
($couponImage, $mimeType) = ZIPLoc::getCouponImage($dbh,
$fdat{'couponid'});
$req_rec->content_type('$mimeType');
# Sending the right header
$escmode = 0;
# No HTML escaping
print OUT $couponImage;
-]
Is there another way to read an image from a database that is compatable
with embpcgi.pl?
Thanks,
Maurice
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: using embpcgi.pl & reading images from database
Posted by Kee Hinckley <na...@somewhere.com>.
At 4:48 PM -0700 6/10/03, Maurice McCabe wrote:
>The following code works when called using mod_perl. It does not work when
>calling via embpcgi.pl. Does anyone have a suggestion why?
>
>[-
> use DBI;
> use ZIPLoc;
> $dbh = DBI->connect("DBI:mysql:locator", "root", "") || die
>"Can't connect:
>$_";
> ($couponImage, $mimeType) = ZIPLoc::getCouponImage($dbh,
>$fdat{'couponid'});
> $req_rec->content_type('$mimeType');
Assome that your problem is there. Is there a request record without Apache?
Try using $http_headers_out{CONTENT-TYPE} instead.
--
Kee Hinckley
http://www.messagefire.com/ Anti-Spam Service for your POP Account
http://commons.somewhere.com/buzz/ Writings on Technology and Society
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: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org