Subject RE: [IBO] How to save a PDF stored in a blob column to a file?
Author Jason Wharton
> I'm having problems understanding how to do this. I am trying like
> this but it doesn't work. Any help would be appreciated:
>
> // extract pdf from db & store to temp file
> (Datamodule5.qryCurrProjDocs.FieldByName("PDFColumn") as
> TBlobField).SaveToFile("TempPdfFullFileName");

Here's another way to do it that avoids a typecast (which is a good idea to
avoid if you can help it):

var
tmp: TStream;
begin
...

tmp := Datamodule5.qryCurrProjDocs.CreateBlobStream(
Datamodule5.qryCurrProjDocs.FieldByName("PDFColumn"), bmRead );
try
tmp.SaveToFile("TempPdfFullFileName");
finally
tmp.Free;
end;
...
end;

PS. I've been a little thin lately due to some continued personal shakeups.
Please be patient with me while I work through my challenges. There's still
a nice light at the end of the tunnel but I've got to get there. Once I'm
there I have it in my plans to finally make the break from my day job so I
will have more time to dedicate to IBO and some of the other activities I am
involved with. Rather than having another baby we are birthing a new way to
earn a living that should give me more time to focus on IBO. The transition
is just a bit rough for the time being.

Thanks,
Jason Wharton