[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 :)
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php