# API Add Media - Error Filetype Not Allowed

**URL:** https://community.xibo.org.uk/t/api-add-media-error-filetype-not-allowed/15552
**Category:** Developer Experience
**Created:** [August 24, 2018, 9:02pm UTC](https://community.xibo.org.uk/t/api-add-media-error-filetype-not-allowed/15552 "2018-08-24T21:02:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![PaulD](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/p/958977/32.png) [@PaulD](https://community.xibo.org.uk/u/PaulD)
#### Post date: [August 24, 2018, 9:02pm UTC](https://community.xibo.org.uk/t/api-add-media-error-filetype-not-allowed/15552/1 "2018-08-24T21:02:06Z")

</div>

Hello,

I am trying to add media to the library via the API. I am using postman, and am able to get a token and retrieve various pieces of data via the API.

I am now trying to upload an image, and am getting this error:

{“files”:[{“name”:“1535143374-0032”,“size”:100279,“type”:“multipart/form-data; boundary=--------------------------005954883975465110847801”,“error”:“Filetype not allowed”}]}

The actual image file types I’ve tried are jpg and png.

Here are a couple of screenshots from Postman:

 ![image](https://community.xibo.org.uk/uploads/default/original/2X/4/4ddf874b2cee21812b9ea52f4ec5f2f992faf14d.png)

 ![uploadError2](https://community.xibo.org.uk/uploads/default/original/2X/4/4fb3325921c3dcaf1589236b330a27b337efdd99.png)

Can anyone give me any tips on what might be causing this?

Thanks!!

---

<div class="post-metadata">

### Author: ![alex](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/alex/32/5782_2.png) [@alex](https://community.xibo.org.uk/u/alex)
#### Post date: [August 30, 2018, 12:07pm UTC](https://community.xibo.org.uk/t/api-add-media-error-filetype-not-allowed/15552/2 "2018-08-30T12:07:47Z")

</div>

I have a feeling you need to use `x-www-form-urlencoded` not `form-data`, but I could be wrong. It’s not really my area of expertise.

---

<div class="post-metadata">

### Author: ![PaulD](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/p/958977/32.png) [@PaulD](https://community.xibo.org.uk/u/PaulD)
#### Post date: [August 31, 2018, 12:56pm UTC](https://community.xibo.org.uk/t/api-add-media-error-filetype-not-allowed/15552/3 "2018-08-31T12:56:51Z")

</div>

Alex,

If I select “x-www-form-urlencoded” rather than “form-data”, then the option to “Choose Files” goes away.

 ![2018-08-31_7-55-56](https://community.xibo.org.uk/uploads/default/original/2X/f/ff8460d492aea2222b574c569c8e53fd821cd09b.png)

Thanks,  
Paul

---

<div class="post-metadata">

### Author: ![Peter](https://community.xibo.org.uk/user_avatar/community.xibo.org.uk/peter/32/8154_2.png) [@Peter](https://community.xibo.org.uk/u/Peter)
#### Post date: [September 3, 2018, 8:50am UTC](https://community.xibo.org.uk/t/api-add-media-error-filetype-not-allowed/15552/4 "2018-09-03T08:50:38Z")

</div>

> [@PaulD](#):
>
> If I select “x-www-form-urlencoded” rather than “form-data”, then the option to “Choose Files” goes away.

You’d need to specify the key type to file again etc.

However that is not needed, `form-data` is what you should use.

 ![image](https://community.xibo.org.uk/uploads/default/original/2X/2/24dce4ab32dc5adb60e952faf4bdeb82a10bd164.png)

 ![image](https://community.xibo.org.uk/uploads/default/original/2X/2/252a27dafe35b15822bc9ef580d071f86d7a87b4.png)

It’s all explained in our API introduction guide, there is also postman collection link there with several calls, including library upload - [API Introduction with Postman](https://community.xibo.org.uk/t/1-8-api-introduction/7702)
