Does DB2 OS / 390 support BLOB .docx file
The ASP.net application inserts the Microsoft Windows 2007..docx file into a row in the DB2 OS / 390 Blob table. Another VB.net application retrieves DB2 OS / 390 Blob data. VB.net launches Microsoft Word to open the .docx file, but then Microsoft Word displays a message that the data is corrupted. Word will let you fix the data so the file can be viewed, but these are additional steps and users are complaining.
I've seen some examples where .docx can be converted to .doc, but they only talk about removing text. Some of our .docx have images in them.
Any ideas?
a source to share
I see this question is 10 months old. I hope it's not too late to be helpful.
Neither DB2 nor any other database that accepts the "Blob" datatype knows that the data is coming from a .docx file or does anything that might cause a Word complaint. The data must be an exact copy of any data that you transmit to her.
Likewise, a Word document does not "know" that it was copied into a BLOB and then back again.
So the problem is almost certainly related to the handling of BLOB data in one or both of your programs.
Run your first program to copy the .docx file to the database, then run the second to read it. Then use a byte tool to compare the two files. One way to do this is to open a command window and type:
fc/b Doc1.docx Doc2.docx
If you have access to some of the best comparison tools, be sure to use them ... but make sure it looks at EVERY BYTE, not just printable characters.
Obviously, you ARE will find the differences, otherwise Microsoft Word will not give you errors in the second, when the first is just fine. Once you see what the differences are, hopefully you can understand what is going wrong and how to fix them.
I had a similar problem a few years ago (I was storing graphics, but it was the same underlying problem). It turns out that the size of the document was affected - I would store 8005 bytes in the BLOB and when I read it, I got 8192 bytes. NUL (0) bytes were appended to the end of the data.
My solution at the time was to add an "X" to the end of the BLOB data when I wrote it to the database. Then, when I read it, I would look for the last "X" in the data and delete it along with any data after it. This way I was able to recover the original data. I had to store the length of the data in the database along with the BLOB data. Then you can trim the file to that size, eliminating corruption.
If the added NUL bytes are not your problem, you will need to do something else to fix the problem. But you don't have a clue until you know what has changed. Something happened.
a source to share