# Send message error 'file must be required'

**URL:** https://community.sendbird.com/t/send-message-error-file-must-be-required/3800
**Category:** API
**Created:** [January 17, 2022, 2:15am UTC](https://community.sendbird.com/t/send-message-error-file-must-be-required/3800 "2022-01-17T02:15:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nddm](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nddm](https://community.sendbird.com/u/nddm)
#### Post date: [January 17, 2022, 2:15am UTC](https://community.sendbird.com/t/send-message-error-file-must-be-required/3800/1 "2022-01-17T02:15:20Z")

</div>

Hello,

I keep getting the following error data when I try to send a message to a group\_channel with the platform API. I’m using Node and axios.

```auto
data: {
    message: "\"file\" must be required.",
    code: 400105,
    error: true,
  },
}

```

I use the following code:

```auto
let url = `${BASE_URL}/v3/group_channels/${channel_url}/messages`;

        const form = new FormData();
        const boundaryString = form.getBoundary();

        let binaryHeaders = {};
        let binaryContentType = `Content-Type`;
        binaryHeaders[binaryContentType] = `multipart/form-data; boundary=${boundaryString}`;
        let binaryHeaderApiToken = `Api-Token`;
        binaryHeaders[binaryHeaderApiToken] = `${TOKEN}`;

        form.append('message_type', "FILE");
        form.append('user_id', userId);
        form.append('file', file);

        let response = await axios.post(url, form, {
            headers: binaryHeaders
        });

```

It’s the same code I use to upload the user’s profile\_image yet here it always says the file must be required. I’ve tried passing a buffer, local file location, stream and it returns the same error all the time even though I’m passing the file in the form.

Can you help me please?

---

<div class="post-metadata">

### Author: ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)
#### Post date: [January 18, 2022, 1:46am UTC](https://community.sendbird.com/t/send-message-error-file-must-be-required/3800/2 "2022-01-18T01:46:13Z")

</div>

Hey @nddm,

Welcome to the Sendbird Community. Let me take a look into this and see if I can recreate it.

---

<div class="post-metadata">

### Author: ![nddm](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nddm](https://community.sendbird.com/u/nddm)
#### Post date: [January 19, 2022, 2:52pm UTC](https://community.sendbird.com/t/send-message-error-file-must-be-required/3800/3 "2022-01-19T14:52:34Z")

</div>

Hey, thank you.

Let me know if you need any more information.

---

<div class="post-metadata">

### Author: ![phil](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/phil/32/2431_2.png) [@phil](https://community.sendbird.com/u/phil)
#### Post date: [May 5, 2022, 6:16pm UTC](https://community.sendbird.com/t/send-message-error-file-must-be-required/3800/5 "2022-05-05T18:16:16Z")

</div>

Ran into the same issue, solved by adding a filename to the FormData append:

```auto
form.append('file', file, "filename.jpg");

```
