Uppy: allowedFileTypes not working for uppercase extensions

Created on 11 Mar 2019  路  6Comments  路  Source: transloadit/uppy

I'm using Uppy.io v0.23.1 for resumeable file uploads.

As per documentation, we can limit file types through allowedFileTypes property.

Here is my code in effort to limit file uploader control to only allow MS PowerPoint files:

`var uppy = new Uppy.Core({
debug: true, autoProceed: false, restrictions: {
maxFileSize: 100000,
allowedFileTypes: ['.pptx']
} });
uppy.use(Uppy.Dashboard, {
trigger: '.UppyModalOpenerBtn',
inline: true,
target: '.DashboardContainer'

});`

Error: You can only upload: .pptx

Note: Setting mime type like ['application/zip'] accepts PPTX files but it also allows ZIP files as well.

Any solution or workaround would be highly appreciated.

PS. Related post on SO.

Most helpful comment

Thanks, will upgrade to the latest release later as it would be major update from 23 to 30.

All 6 comments

@goto-bus-stop , allowedFileTypes: ['.PPTX'] doesn't resolve the issue either.

that doesn't work for a file named xyz.PPTX? right now, it's case sensitive, so if you do allowedFileTypes: ['.pptx', '.PPTX'] it should accept both. in the next release (will be 0.30.4 or 0.31.0) you can just do one and it'll work for all casings.

I tried with allowedFileTypes: ['.pptx', '.PPTX'], and my file names are xyz.pptx and abc.PPTX. In both cases, it didn't work.

*Error: * You can only upload: .pptx, .PPTX

As said earlier, it accepts PowerPoint files when I'm using allowedFileTypes: ['application/zip'] but then it also accepts ZIP files that I don't want to.

So I think the root cause of this problem is something else, and Title of the issue should be reverted back to original title.

Ah, 0.23 is a very old version that doesn't support extensions at all, only mime types. Extension support was added in a 0.25.x version. You would need to update (ideally to 0.30 if possible) to be able to use allowedFileTypes: ['.ext'].

Thanks, will upgrade to the latest release later as it would be major update from 23 to 30.

Is it fixed in 30.x version ? I'm getting the same issue even in 0.30

Was this page helpful?
0 / 5 - 0 ratings

Related issues

evanoberholster picture evanoberholster  路  3Comments

risonsimon picture risonsimon  路  4Comments

NihadOb picture NihadOb  路  3Comments

ameft picture ameft  路  4Comments

enneid picture enneid  路  4Comments