# Bulk load messages with images

**URL:** <https://forum.mattermost.com/t/bulk-load-messages-with-images/15808>\
**Category:** Command Line Interface\
**Created:** [April 30, 2023, 4:17am UTC](https://forum.mattermost.com/t/bulk-load-messages-with-images/15808 "2023-04-30T04:17:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/cro/32/6708_2.png) [@cro](https://forum.mattermost.com/u/cro)\
**Post date:** [April 30, 2023, 4:17am UTC](https://forum.mattermost.com/t/bulk-load-messages-with-images/15808/1 "2023-04-30T04:17:34Z")

</div>

Greetings,

I am attempting to write a script to create a bulk import file from messages exported from Element and include images (and other media files). In the Element export it looks like posts with images are treated as a message by themselves, while in the Mattermost bulk import format they are “attachments”. [Bulk loading data — Mattermost documentation](https://docs.mattermost.com/onboard/bulk-loading-data.html#example-post-object) seems to indicate that the path to the images should be on the local filesystem, but the bulk upload is in a zipfile, so I was assuming that it would be a relative path to the images inside the zip. An example JSONL entry out of my import file looks like the following (lines broken for readability) with the images in a directory in the zipfile called `ima`.

```auto
{"post":
   {"attachments":[{"path":"ima/ima_04ea3d5.jpeg"}],
    "channel":"techwizardtest",
    "create_at":1678742223264,
    "message":"ima_04ea3d5.jpeg",
    "props":{
      "attachments":[{"text":"image ima_04ea3d5.jpeg"}]
    },
    "team":"ncbt",
    "user":"josiah"},
 "type":"post"}

```

So this isn’t quite working–I get all the messages fine, but none of the images appear. I must be missing something with respect to actually getting the media files into Mattermost because when browsing my S3 bucket I don’t see any of the images that should be there.

How can I get the images onto the Mattermost installation and how do I need to reference them in the import file?

Thanks!
