# Forms with Asset/File Upload

**URL:** <https://discourse.getcockpit.com/t/forms-with-asset-file-upload/2691>\
**Category:** Cockpit v2\
**Created:** [February 7, 2023, 6:05pm UTC](https://discourse.getcockpit.com/t/forms-with-asset-file-upload/2691 "2023-02-07T18:05:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielWahl](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/danielwahl/32/1481_2.png) [@DanielWahl](https://discourse.getcockpit.com/u/DanielWahl)\
**Post date:** [February 7, 2023, 6:05pm UTC](https://discourse.getcockpit.com/t/forms-with-asset-file-upload/2691/1 "2023-02-07T18:05:56Z")

</div>

Hi everyone,

I have a question, how exactly is the asset/file uploading via form/inbox working?

I’ve created a simple form (in React) with a fetch request via the `/inbox/submit/token`-endpoint.  
Everything works and is being saved, except the file upload.  
The data is transferred via FormData as body and with a `multipart/form-data` header.

The response I’m getting back from Cockpit is an empty `attachments` array.

 ![cockpit-formdata-upload-response](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/2X/8/8764bf71279fb8eee281638ce170f25fa49fbe23.png)

Do I need to give the role access to upload assets?  
Where are the assets/files uploaded?

Thanks in advance.

Best,  
Daniel
