0

G'd day, everyone...

Here is the scenario. My user wants to save a PDF file into the database (yeah, I know, that's not the optimal way to do it, but ... he pays, so I keep my mouth shut ;) ), so I decided to create a Binary column in a table in SQL Server 2008 R2 database.

And now, the problem. I'm developing in Delphi 6, and I have the slightest idea how to accomplish this..., can you provide me kinda help here, please?

Thanks in advance for your kindness.

2
  • 2
    Not being a Delphi guy myself, I'll tread lightly here. But, I would recommend varbinary(max) for the data type, instead of binary. Binary is limited to 8k, but varbinary(max) allows up to 2GB (source: msdn.microsoft.com/en-us/library/ms188362.aspx) Commented Mar 15, 2012 at 16:57
  • There are a lot of well known products that store files inside the DB. SharePoint is one of them (although there is a SharePoint external storage API also). BTW, "but ... he pays, so I keep my mouth shut" - this kind of approach can backfire at you later. Commented Mar 15, 2012 at 23:14

1 Answer 1

4

You can stream the PDF into a blob field. I use this technique for saving .JPG and .PNG images into a DBISAM database. You can probably find examples of doing this for images (stream an image into a blob field).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.