# FileUpload filebytes convert to \`multipart/form-data\` compatible data

**URL:** <https://forum.inductiveautomation.com/t/fileupload-filebytes-convert-to-multipart-form-data-compatible-data/52749>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [November 4, 2021, 8:51pm UTC](https://forum.inductiveautomation.com/t/fileupload-filebytes-convert-to-multipart-form-data-compatible-data/52749 "2021-11-04T20:51:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [November 4, 2021, 8:51pm UTC](https://forum.inductiveautomation.com/t/fileupload-filebytes-convert-to-multipart-form-data-compatible-data/52749/1 "2021-11-04T20:51:03Z")

</div>

I’m working on an integration between Ignition and a video platform and part of the process is obviously uploading a video. However, I’m running into a problem uploading the video - the API docs state that the video upload request must be sent with a payload and the content type must be `multipart/form-data`.

Here is the request format:

```auto
curl -X POST \
     -F 'file=@/path/to/your/video.mp4' \
     '<UPLOAD_URL>'

```

How do I convert a byte array (coming from the File Upload component) into something I can send as part of the request?

---

<div class="post-metadata">

**Author:** ![ryan.perretta](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.perretta/32/75110_2.png) [@ryan.perretta](https://forum.inductiveautomation.com/u/ryan.perretta)\
**Post date:** [April 25, 2023, 12:58pm UTC](https://forum.inductiveautomation.com/t/fileupload-filebytes-convert-to-multipart-form-data-compatible-data/52749/2 "2023-04-25T12:58:12Z")

</div>

Hi, I am trying to do the same conversion right now from a file byte array to the multipart/form-data for an API request. I was curious to know if you had ever found a solution for this?

---

<div class="post-metadata">

**Author:** ![calimero100582](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/calimero100582/32/18630_2.png) [@calimero100582](https://forum.inductiveautomation.com/u/calimero100582)\
**Post date:** [April 25, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/fileupload-filebytes-convert-to-multipart-form-data-compatible-data/52749/3 "2023-04-25T18:13:09Z")

</div>

On my side, I did this couple of weeks ago

> [@Webdev upload fail](https://forum.inductiveautomation.com/t/webdev-upload-fail/54451/8):
>
> I know this is marked as solved, but if other stumble here and want some kind of solution, I parse the POST data as we cannot rely on servletRequest. Only thing is that I prepend date and time to the filename from com.inductiveautomation.ignition.gateway import IgnitionGateway import os import re if request["servletRequest"].getContentType() and request["servletRequest"].getContentType().startswith("multipart/form-data"): today = system.date.now() backupTime = system.date.format(to…
