# MQTT bin file streaming

**URL:** <https://forums.freertos.org/t/mqtt-bin-file-streaming/22946>\
**Category:** Libraries\
**Tags:** aws-iot-core\
**Created:** [April 17, 2025, 9:22am UTC](https://forums.freertos.org/t/mqtt-bin-file-streaming/22946 "2025-04-17T09:22:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jhon](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jhon](https://forums.freertos.org/u/Jhon)\
**Post date:** [April 17, 2025, 9:22am UTC](https://forums.freertos.org/t/mqtt-bin-file-streaming/22946/1 "2025-04-17T09:22:39Z")

</div>

**I have a `.bin` file that I want to stream over MQTT.**  
Is it necessary to convert the binary file to Base64 before sending, or can I stream raw binary data directly over MQTT?

---

<div class="post-metadata">

**Author:** ![karahulx](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/karahulx/32/4893_2.png) [@karahulx](https://forums.freertos.org/u/karahulx)\
**Post date:** [April 17, 2025, 12:10pm UTC](https://forums.freertos.org/t/mqtt-bin-file-streaming/22946/2 "2025-04-17T12:10:55Z")

</div>

You can stream raw binary data directly over MQTT . MQTT treats the message payload as an opaque byte buffer (`uint8_t*` with a length), so it does not care what the contents are.

You might only need to encode in Base64 if the MQTT broker or subscriber expects text-only payloads.

---

<div class="post-metadata">

**Author:** ![Jhon](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jhon](https://forums.freertos.org/u/Jhon)\
**Post date:** [April 19, 2025, 6:07am UTC](https://forums.freertos.org/t/mqtt-bin-file-streaming/22946/3 "2025-04-19T06:07:42Z")

</div>

Hi [karahulx](https://forums.freertos.org/t/mqtt-bin-file-streaming/22946/2),

How can I implement MQTT file streaming using a custom job?  
like I want to perform a custom OTA-like job over MQTT.

---

<div class="post-metadata">

**Author:** ![karahulx](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/karahulx/32/4893_2.png) [@karahulx](https://forums.freertos.org/u/karahulx)\
**Post date:** [April 19, 2025, 6:34am UTC](https://forums.freertos.org/t/mqtt-bin-file-streaming/22946/4 "2025-04-19T06:34:50Z")

</div>

You can use [MQTT File Streams](https://freertos.org/Documentation/03-Libraries/03-FreeRTOS-core/10-coreMQTT-Streams/01-coreMQTT-Streams) as a reference.  
This page also contains demos to help provide a starting point.  
This AWS [docs](https://docs.aws.amazon.com/iot/latest/developerguide/mqtt-based-file-delivery.html) also will help you get started.
