# Invalid file type

**URL:** <https://forum.getkirby.com/t/invalid-file-type/20891>\
**Category:** Questions\
**Tags:** v3\
**Created:** [January 22, 2021, 2:19pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891 "2021-01-22T14:19:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aristotheme](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aristotheme/32/178_2.png) [@aristotheme](https://forum.getkirby.com/u/aristotheme)\
**Post date:** [January 22, 2021, 2:19pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/1 "2021-01-22T14:19:50Z")

</div>

Why I cannot upload .woff2 file format? I could before…

type : files  
headline : Files  
type : files  
empty : Maybe words are all you need…  
sortBy : filename desc  
template : default  
limit : 16  
image:  
cover : true  
back: transparent

 ![eroor](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/5/56b948699cf20d67b13448965562ec5fcae538bd.jpeg)

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [January 22, 2021, 2:44pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/2 "2021-01-22T14:44:58Z")

</div>

The by default uploadable files have been restricted. You now have to set additional allowed filetypes in your file blueprint. See the changelog…

---

<div class="post-metadata">

**Author:** ![ahmetbora](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/ahmetbora/32/11671_2.png) [@ahmetbora](https://forum.getkirby.com/u/ahmetbora)\
**Post date:** [January 22, 2021, 2:49pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/3 "2021-01-22T14:49:38Z")

</div>

Also checkout `accept` option on file blueprint

> **[File blueprint](https://getkirby.com/docs/reference/panel/blueprints/file#accept)**
>
> File blueprints are located in /site/blueprints/files and control the Panel setup and form fields for individual file types.

---

<div class="post-metadata">

**Author:** ![aristotheme](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aristotheme/32/178_2.png) [@aristotheme](https://forum.getkirby.com/u/aristotheme)\
**Post date:** [January 22, 2021, 3:00pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/4 "2021-01-22T15:00:35Z")

</div>

What should I write;  
accept: image/jpeg, image/png, woff2 ?

---

<div class="post-metadata">

**Author:** ![aristotheme](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aristotheme/32/178_2.png) [@aristotheme](https://forum.getkirby.com/u/aristotheme)\
**Post date:** [January 22, 2021, 3:07pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/5 "2021-01-22T15:07:33Z")

</div>

Okay I got it. Thank you so much Bora

---

<div class="post-metadata">

**Author:** ![exeldoc](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/exeldoc/32/6224_2.png) [@exeldoc](https://forum.getkirby.com/u/exeldoc)\
**Post date:** [June 24, 2021, 4:04pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/6 "2021-06-24T16:04:04Z")

</div>

Similar problem here.

Would like to make a pgp-publik-key uploadable via the panel.

```
pgpkey:
   type: files
   multiple: false
   accept:
       extension: asc

```

I would expact this to work, but it doesn’t. 🤕

---

<div class="post-metadata">

**Author:** ![mrflix](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mrflix/32/14443_2.png) [@mrflix](https://forum.getkirby.com/u/mrflix)\
**Post date:** [December 1, 2021, 2:41pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/7 "2021-12-01T14:41:54Z")

</div>

I ran into the “invalid filetype” error message on a windows server in a case where I create a temporary file using `tmpfile()`.

The temp-file has a **.tmp** extension on windows:

### Linux

`/private/var/tmp/phpoVvwgt`

### Windows

`C:\Windows\Temp\phpCB62.tmp`

I get image data from an API and load it into Kirby like this:

```php
$temp = tmpfile();
fwrite($temp, $imageResponse);
$page->createFile([
	'source' => stream_get_meta_data($temp)['uri'],
	'template' => 'product-title-image',
	'filename' => $filename
]);
fclose($temp);

```

The `$filename` contains the correct extension (example: db141370.jpg) so I didn’t expect that Kirby would have a problem here.

Took quite some time to debug this. In order to allow both cases I created a file-blueprint and set `accept: true` to disable the filetype-check.

---

<div class="post-metadata">

**Author:** ![mrflix](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mrflix/32/14443_2.png) [@mrflix](https://forum.getkirby.com/u/mrflix)\
**Post date:** [December 13, 2021, 4:39pm UTC](https://forum.getkirby.com/t/invalid-file-type/20891/8 "2021-12-13T16:39:11Z")

</div>

1. you have to use a section
2. you have to apply a template to the uploaded files:

```auto
sections:
  pgpkey:
    headline: PGP Key
    type: files
    max: 1
    template: pgp-key

```

1. You have to create create the [file blueprint](https://getkirby.com/docs/reference/panel/blueprints/file) `pgp-key.yml` and add `accept: asc` there.
