Re: PDF BLOB to Email

From: Date: Thu, 11 May 2006 13:39:33 +0000
Subject: Re: PDF BLOB to Email
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-41848@lists.php.net to get a copy of this message
[snip] No, not "Obviously", PHP is not well suited for many tasks (or has a high cost to get the suit tailored) :) [/snip] "Obviously " because i am posting to a PHP list, numpty! but thank you for the recommendation anyway. JupiterHost.Net wrote:
Adrian Bruce wrote:
Hi
Hello,
I have pdf's stored as a blob in a MySQL database, how can i set a script (PHP obviously!) to email these blobs as pdf files. The only way
No, not "Obviously", PHP is not well suited for many tasks (or has a high cost to get the suit tailored) :) If you branch out you'll find a whole world of alternatives that are easier to code and maintain server wise. All without the onslaught of PHP security vulnerabilities and performance bloats.
i can think of at the moment is to write them to disk and then attach them to the mail before sending it. This doesn't seem that efficient but perhaps it is the only way??
Nope, its fine to attach it from a variable, in fact an example of how to do just that can be found at http://search.cpan.org/perldoc?Mail::Sender::Easy under the "EXAMPLE" header. you'd simply: my($pdf_guts) = $dbh->selectrow_array(q{SELECT pdf_guts FROM pdf_store WHERE id = '123'}); # http://search.cpan.org/perldoc?DBI PHP's mail() is a lame lame function with limited ability and even higher hackability, don't use it. HTH :)


« previous php.db (#41848) next »