Page 2 -
Save content pdf to database and retrieve it
Page 2 - Discuss Save content pdf to database and retrieve it in the PHP Development forum on Dev Shed. Save content pdf to database and retrieve it PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
Time spent in forums: 2 Months 1 h 34 m 43 sec
Reputation Power: 4538
A couple of the stackoverflow posts found in this search have some example php snips for storing pdf's in a blob. It's often difficult to get a rational answer to any question asking about storing images and other binary data in a db, there are far too many who'd rather just say "store in the file system", even though that's not an answer to the question.
Time spent in forums: 2 Months 3 Weeks 5 Days 11 h 11 m 57 sec
Reputation Power: 1063
Originally Posted by Doug G
It's often difficult to get a rational answer to any question asking about storing images and other binary data in a db, there are far too many who'd rather just say "store in the file system", even though that's not an answer to the question.
A small update for you, since you appearently stopped at the second post: The data already is in a BLOB, I explained how to move it into an email attachment, and now there seems to be a concrete issue with PHPMailer.
I you actually wanna help and not just throw around accusations and useless links, then help him with the PHPMailer problem. Thanks.
Time spent in forums: 2 h 22 m 45 sec
Reputation Power: 0
I solved my problem...
I don't know if it was the best choice I made but the solution for my problem was:
1º) generate pdf and save it into folder.
2º) Save name of pdf file into database.
3º) Check if the pdf file is in the folder.
4ª) Compare name of pdf file in the folder and the name on the Database.
5ª) attach the pdf file with AddAttachment.
6º) Sending email
Works fine and I can sending multiple emails wihtout problems
Time spent in forums: 3 Weeks 4 Days 15 h 34 m 24 sec
Reputation Power: 1020
Originally Posted by jonito
So you tell me there's no way to save content of the pdf?
I know storing pdf file into file system is the best way but, in my case, I don't need this because is unnecessary. I don't want to overload my site with thousands of pdf files.
Just that...If there's no way to store content of pdf file like I want then I will use your methods
You are going to overload your database system long before you overload your filesystem. That isn't what databases are intended for, and if you don't need the PDFs after they have been sent out you can either archive them on another machine through FTP or delete them when no longer needed.