How to import multimedia and attach it to a record

We would like to import an image and attach it to a Catalog record.

In this example we use a .CSV import file to import an image and create a Multimedia record, and attach the new Multimedia record to a Catalog record:

  • As we've seen, when loading multimedia with the Import tool it is necessary to use the virtual Multimedia field.
  • The import is run from the Catalog module. A record will be created in the Multimedia module and attached to the Multimedia field in the Catalog module.
  • The Multimedia field in the Catalog module is both an attachment field and a table, giving us MulMultimediaRef_tab.
  • We want to append the newly created Multimedia record to the Catalog record, not replace any multimedia already attached to the record, so it is necessary to use the (+) option in our .CSV file: the (+) indicates that the row position for the newly attached record is after the last value in the table.

    This all gives us MulMultimediaRef_tab(+).Multimedia

  • The IRN column holds the irn of the Catalog record(s) to which the newly created Multimedia record(s) will be attached.

    Note: For display purposes only the import data below is presented with column headings listed vertically rather than horizontally. The first row of any tab or comma delimited file must include the column names. The appropriate layout is:

irn

MulMultiMediaRef_tab(+).Multimedia

MulMultiMediaRef_tab(+).MulTitle

1000208

C:\Users\gerard\Desktop\IMAGE.jpeg

Test import image

The import data is:

Column Name (must appear as the first row of the import data file)

Record 1

Description

irn

1000208

The IRN of the Catalog record to which the newly created Multimedia record will attach.

MulMultiMediaRef_tab(+).Multimedia

C:\Users\gerard\Desktop\IMAGE.jpeg

The virtual Multimedia field in the Catalog. This is an attachment field and table. The (+) indicates that the attachment is appended to the table.

Here we provide the pathway to the image.

MulMultiMediaRef_tab(+).MulTitle

Test import image

 

MulMultiMediaRef_tab(+).MulDescription

An image used to test our import

 

MulMultiMediaRef_tab(+).MulCreator_tab(1)

Gerard Wood

 

Before the import is run, the Catalog record displays as:

Import

After the import:

mod_cat_import_multimedia_example2.png

And in the Multimedia module we have a new record for the image:

Import

The Import log is:

Import log