Wednesday 4 December 2002 — This is over 20 years old. Be careful.
A recent email correspondent asked:
How can I decompress the huffman-compressed file attachments in Notes?
The answer is: you can’t. The Notes C API provides no facility to do this, and Lotus (or IBM or Iris, or whatever they should be called now) has never documented the compression algorithm. The only way to decompress these attachments is to use the C API functions NSFNoteExtractFile or NSFNoteExtractFileExt. Both of these functions take a filename, and the decompressed data is written to the file.
Of course, this is really stupid. For one thing, when writing high-throughput software, the last thing you want to do is write more data to disk. If I need to process the data in a file attachment, I want a way to read the data into memory, and writing it to a temp file just to read it back in so I can do whatever to it, is just wasteful.
Of course, IBM (or Lotus or Iris, or whatever) has functions to do the decompression, they just haven’t been exposed as part of the C API.
I used to work at Iris (or Lotus, or whatever), but I don’t know how the compression works, or what the functions are to do the decompression. I’d like to have access to them as well, but I’m in the same boat as everyone else.
I really am in trouble trying to use the NSFNoteExtractFile. I could not ask anyone else other than yourself. I have seen all the posts on notes.net and none seem to give me a working answer. The requirement is quite simple. Detach attachments to a folder of all the messages going through a mail box. I have written a extension manager and that goes through all the $FILE items one by one using the NSFItemInfo and NSFItemInfoNext and for every BLOCKID it finds it tries to call NSFNoteExtractFile. Just before I call NSFNoteExtractFile i also find the name of the original attachment using the FILEOBJECT structure read from the items value BLOCKID. I always get the same error "Specified database is not currently open". Now the documentation says that if the extension manager event is EM_BEFORE then all the handles will be valid. So i have tried it on EM_BEFORE and EM_AFTER. Nothing seems to be working. I can mail you the entire source code if you want. But please...please..help. I will post your solution to notes.net and you will be helping not only me but quite a few people.
Thanks in advance.
Add a comment: