- Mike Kochevar
- PowerBuilder
- Wednesday, 10 July 2024 02:23 PM UTC
Good day to you!
I am trying to extract the file contents from a blob saved to the database using an OLE object in PB12.6. The blob seems to save to the database as .CFB files. I see this when using PL/SQL dbms_lob.substr(document,2000,1) the value D0CF11E0A1B11AE1 are the first characters and from what I have read from google searches is that D0CF11E0A1B11AE1 is the header for OLE or .CFB (microsoft compound file binary) file.
Due to bad design I had to figure out the file extension and construct a file name from the blob, I am able to save the blob to disk but files of type .png, .jpg, or .jpeg will not open (windows sees the files are corrupt). Word docs (.doc and .docx) will open but Word is able to fix any problems when opening. Excel spreadsheets (.xls and .xlsx) will open as Excel will fix any problems as Word does. Adobe (.pdf) opens without error (the only success I have had).
I have tried to save the file using PL/SQL scripts, .Net app, and now I am trying to parse through the blob using an OLE object in PowerBuilder 12.6 and save the file to disk but I am getting the same results as I mentioned above. I have seen a solution where the blobs can be saved as .zip files and then 7Zip can be used to open the files but this is not a practical solution for our client as there are 100k+ files to save.
Does anyone have an advice for me on how I can continue with this project?
Thank you for your time,
Mike
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.