Subject AW: [IBO] Re: Storing PDF into Firebird Blobs
Author Terry Black
Hi, thanks Herbert. If I am storing the PDF file contents in a blob file then do I need to store the actual PDF files at all. In theory I could store the PDF in a blob then delete the PDF file. Do you think this is a reasonable approach?

Terry

IT Manager | Public Health Unit Hornsby | Health Reform Transitional Organisation Northern
Hornsby Hospital, Main Building 1, 36-76 Palmerston Road, Hornsby NSW 2077
Tel. 02 9477 9400 | Fax. 02 9482 1650 | tblac@...
www.health.nsw.gov.au


>>> "Herbert Senner" <hsenner@...> 23/05/2012 1:55 am >>>
Terry,



I would store all these files in the same path, but with different file
names

(e.g. constructed by the key field(s) of your qryScan row, which would

uniquely identify the file and link it to the row).



You might have to check before writing the blob to a file if this concrete
file already
exists and then decide to delete it first and to create it newly (to
"reload") or not
to reread the blob's content and to view this existing file.



Herbert



Von: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] Im Auftrag
von Terry Black
Gesendet: Dienstag, 22. Mai 2012 06:48
An: IBObjects@yahoogroups.com
Betreff: AW: AW: [IBO] Re: Storing PDF into Firebird Blobs





Thanks, Herbert and Jason - the code works well. I can load PDF images into
blob fields. My intention is to just click on a record in a table and have
it display the contents of the blob which is a PDF. But I have a problem
with the Blob being saved to a file.

When I click on the first record
DM.qryScan.FieldByName('PDFIMAGE').SaveToFile(myPath + '\myPdf.pdf') the
first time it creates a file called myPDF.pdf when I click on the second
record I get an EFCreateError ' Cannot create file D:\apdf\mypdf.pdf' the
process cannot access the file because it is being used by another process.

In other words I need to write it to some temporary location.

Terry






[Non-text portions of this message have been removed]


Disclaimer: This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender.

Views expressed in this message are those of the individual sender, and are not necessarily the views of the Local Health District or associated entities.