Question :
Just a quick question on whether something is possible to do.
Database: MSSQL
We have a customer that we generate emails for based on sales (e.g. Sales Person X sold Y amount of stock). Against these orders the main system generates a PDF stored as a VARBINARY field in a table.
Is it possible for this VARBINARY to be converted into a physical file (as an attachment or similar) within an email?
I have done similar things with images stored in the database but that is a a lot different than PDF.
This is a Third party application i’m working with so I can’t make changes their system.
Thanks for Reading,
Joshua
Answer :
I have done similar things with images stored in the database but that is a a lot different than PDF.
Actually, for this type of operation, there is no difference between images, PDF, or anything. If you have a binary representation of a file and can save it to disk, then that will work for all file types. Bytes are bytes, and as long as the same bytes are written in the same sequence that they were read in (written as binary, not text), then it doesn’t matter what those bytes end up being, even if it is a plain text file or image or DLL or mp3, etc.