Home > Lotus Notes Software, Lotus Notes Solution, Lotus Notes Tutorial > Transfer attachments from a BLOB data type into Notes Rich Text field

Transfer attachments from a BLOB data type into Notes Rich Text field

This behavior is expected because the conversion format Notes did not note the header files specified in the RTF (Rich Text Field) to transfer files from the column drops to Notes. RTF follow these steps.

  1. Create a File Connection Document (in LEI 3.x) or a Connection to File System Document (in LEI 6.x), checking the option “Binary File Contents”.
  2. Create a Direct Transfer Activity in which you specify in the field Subdirectory the Directory on the hard drive where the files will be transferred (below Data directory).
  3. You can have a column of varchar type in the RDB in which you specify the file name. When you create the Direct Transfer Document, map this column with the Target Field “Filename”. Also, map the BLOB field containing the attachment with the target Field “Content” (LEI says that “Content” is of type Text, but it works.).
  4. Run the Direct Transfer Activity. The files will be placed on the hard drive in the specified directory.
  5. Use a LotusScript agent to insert the files from the shared directory into the RTF. To fetch the right file with the LS agent, you can use the file name that had been previously replicated into the Notes document, using a Direct Transfer Activity, for instance.

If you need to do some testing with attachments in a BLOB, here is an easy way to insert a file into an Oracle Table:

  1. Create the table blobtab with a column ID of type Integer and ATT of type BLOB.
  2. Create a control file, for instance, input.ctl, in the same directory as the .pdf + .doc file, /tmp/input.ctl containing this:
    LOAD DATA
    INFILE ‘input.dat’
    INTO TABLE blobtab
    REPLACE
    FIELDS TERMINATED BY ‘;’
    (ID INTEGER EXTERNAL,
    input.log FILLER CHAR,
    ATT LOBFILE(input.log) TERMINATED BY EOF)

3. Create an empty input.log file, such as “/tmp/input.log.”
4. Create the data file, also in /tmp – /tmp/input.dat, containing:

    • 1;/tmp/ora8.pdf
    • 1;/tmp/readme.doc

You can add more lines if required:

    • 3;/tmp/anotherfile.doc (for example)

5. Enter cd /tmp.
6. Go to sqlldr user/password@DatabaseSID control=input.ctl log=input.log.

Viewed 36918 times by 12724 viewers

  1. No comments yet.
  1. No trackbacks yet.