# The selected file "dummy.pdf" has an unsupported format. Please use one of the following types: application/pdf, image/\*

**URL:** <https://forum.shopware.com/t/the-selected-file-dummy-pdf-has-an-unsupported-format-please-use-one-of-the-following-types-application-pdf-image/98077>\
**Category:** Programming (EN)\
**Tags:** administration\
**Created:** [19. Januar 2023 um 05:00 UTC](https://forum.shopware.com/t/the-selected-file-dummy-pdf-has-an-unsupported-format-please-use-one-of-the-following-types-application-pdf-image/98077 "2023-01-19T05:00:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abinjohnedamana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/abinjohnedamana/32/17378_2.png) [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Post date:** [19. Januar 2023 um 05:00 UTC](https://forum.shopware.com/t/the-selected-file-dummy-pdf-has-an-unsupported-format-please-use-one-of-the-following-types-application-pdf-image/98077/1 "2023-01-19T05:00:47Z")

</div>

I am getting the following error when I am trying to upload a pdf file in Settings → Email templates → Attachments

> The selected file „dummy.pdf“ has an unsupported format. Please use one of the following types: application/pdf, image/\*.

---

<div class="post-metadata">

**Author:** ![abinjohnedamana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/abinjohnedamana/32/17378_2.png) [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Post date:** [19. Januar 2023 um 05:33 UTC](https://forum.shopware.com/t/the-selected-file-dummy-pdf-has-an-unsupported-format-please-use-one-of-the-following-types-application-pdf-image/98077/2 "2023-01-19T05:33:22Z")

</div>

This is a Shopware Bug in [platform/index.js at a9c8a171dec581c42697a0e9c5a845ab4949a863 · shopware/platform · GitHub](https://github.com/shopware/platform/blob/a9c8a171dec581c42697a0e9c5a845ab4949a863/src/Administration/Resources/app/administration/src/app/component/media/sw-media-upload-v2/index.js#L448)

This issue can be fixed by changing the function to something like the following.(For developers we have to override the component)

```auto
const { Component } = Shopware;

Component.override('sw-media-upload-v2', {
    methods: {
        checkFileType(file) {
            if (!this.fileAccept || this.fileAccept === '*/*') {
                return true;
            }

            const fileTypes = this.fileAccept.split(',');

            var FileTypeValid = false;

            fileTypes.forEach(fileType => {

                if(!FileTypeValid) {
                    const fileAcceptType = fileType.split('/');
                    const currentFileType = file?.type?.split('/') || file?.mimeType?.split('/');

                    console.log('fileAcceptType:'+fileAcceptType);
                    console.log('currentFileType:'+currentFileType);

                    if (fileAcceptType[0] !== currentFileType[0]) {
                        this.isCorrectFileType = false;
                        return;
                    }

                    if (fileAcceptType[1] === '*') {
                        this.isCorrectFileType = true;

                        FileTypeValid = true;

                        return;
                    }

                    this.isCorrectFileType = fileAcceptType[1] === currentFileType[1];

                    if (this.isCorrectFileType) {
                        FileTypeValid = true;
                    }

                    console.log('fileAcceptType-1:'+fileAcceptType[1]);
                    console.log('currentFileType-1:'+currentFileType[1]);

                    console.log('isCorrectFileType:'+this.isCorrectFileType);
                }
            });

            if (this.isCorrectFileType) {
                return true;
            }

            this.createNotificationError({
                title: this.$tc('global.default.error'),
                message: this.$tc('global.sw-media-upload-v2.notification.invalidFileType.message', 0, {
                    name: file.name || file.fileName,
                    supportedTypes: this.fileAccept,
                }),
            });
            return false;
        },
    }
}); 

```
