Subject | [IBO] Re: How to save a PDF stored in a blob column to a file? |
---|---|
Author | mitch_landor |
Post date | 2007-10-26T12:49:50Z |
--- In IBObjects@yahoogroups.com, "Martijn Tonies" <m.tonies@...> wrote:
Thank you Martijn for being a lifesaver!
>message and
>
> > > > > > // extract pdf from db & store to temp file
> > > > > > (Datamodule5.qryCurrProjDocs.FieldByName("PDFColumn") as
> > > > > > TBlobField).SaveToFile("TempPdfFullFileName");
> > > > >
> > > > > Why doesn't it work?
> > > >
> > > > When I try to read the file it gives a "corrupted" error
> > > > the size is far too small, just a few bytes. If the above codeshould
> > > > work then perhaps the pdf is stored incorrectly in the db, butI don't
> > > > know how to check this. Can I check the size of the blob which isfunction" or
> > stored?
> > >
> > > What is the sub-type of the blob?
> > >
> > > And yes, you can check the size, but you need an "external
> > > "udf" for this.http://www.google.com/search?q=f_blobsize+udf&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
> > >
> > >
> >
>
> > >Changing the subtype to 0 seems to have fixed it!
> > >
> >
> > It's sub-type 2.
>
> Don't use sub-type 2!! It's a system defined sub-type that causes
> IBO to transform the blob from binary to human readable BLR.
>
> Are you using IBManager/Quickdesk from EMS Hitech, or have
> you been using it?
>
> > I am now trying to figure out how to use the F_BLOBSIZE UDF. I've
> > never installed or used a UDF before.
>
> It's sub-type 2, don't bother. IBO will read your blob in the wrong
> way (actually, quite helpful, but you've made a mistake there :) ).
>
> Change the subtype to 0 (= binary).
>
> Martijn Tonies
Thank you Martijn for being a lifesaver!