# How to Process Multipart Form Data with a Netlify Function

**URL:** <https://answers.netlify.com/t/how-to-process-multipart-form-data-with-a-netlify-function/49732>\
**Category:** Support\
**Tags:** deployment\
**Created:** [January 8, 2022, 6:57am UTC](https://answers.netlify.com/t/how-to-process-multipart-form-data-with-a-netlify-function/49732 "2022-01-08T06:57:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![coelmay](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/coelmay/32/24427_2.png) [@coelmay](https://answers.netlify.com/u/coelmay)\
**Post date:** [January 9, 2022, 9:51am UTC](https://answers.netlify.com/t/how-to-process-multipart-form-data-with-a-netlify-function/49732/5 "2022-01-09T09:51:00Z")

</div>

You might find this answer helpful @Naveen1401 as it contains a workable function (need to change `const busboy = new Busboy({headers: event.headers)` to `const busboy = Busboy({headers: event.headers})` if using `busboy@1.3.0` I found)

> [@Trouble with handling files in Netlify Function](https://answers.netlify.com/t/trouble-with-handling-files-in-netlify-function/42418/17):
>
> Hi @Coderr, It’s because the event.body is base64 encoded. You need to use Buffer.from(event.body, 'base64').toString('utf8'). Full code: import { initializeApp } from 'firebase/app' import { getStorage, ref, uploadString } from 'firebase/storage' const Busboy = require('busboy') exports.handler = async event =\> { return new Promise(resolve =\> { const fields = {} const busboy = new Busboy({ headers: event.headers }) busboy.on('file', (fieldname, filestream, file…

---

_[View the full topic](https://answers.netlify.com/t/how-to-process-multipart-form-data-with-a-netlify-function/49732)._
