The archaic application i’m working on crashes because of the amount of imageResources (8000!). I’m looking for a way to export the not-used part of them via script.
So far I’ve found “Eds Blue” database on the openntf site. It offers me a fine solution to export imageResources to the filesystem. From there I could pick them up en transform them into attachments, stored in a notesdoc.
Fact is that all of this has to take place scheduled on a server. I’d rather take the in-memory file and create an attachment directly, but how…?
By the way, this code is now used to write to disc:
Subject: RE: export imageResource to an attachment
“NotesStream is always associated with a file on the hard drive …”
Is it? What about using Read or ReadText and Write or WriteText for in-memory strings and byte arrays?
I’m pretty sure that it can be done. The output of a NotesDXLExporter for each design note could be parsed for the encoded image data, this data could go to a NotesStream object. A NotesDXLImporter could take a prepared DXL (eg. stored in a string constant), replace the filedata with data from the NotesStream and finally create the required documents in the target database.
Subject: RE: export imageResource to an attachment
Harkpabst,
Before you can read or write text to a NotesStream, you have to open it first. The syntax for NotesStream’s Open method requires the path to a file on the hard drive. Therefore, I/O is unavoidable.