"limiting" uploads by file mime extension type via the "Strapi UI"

  • Strapi Version: latest
  • Operating System: macOS, Linux
  • Database: MongoDB Atlas
  • Node Version: 12.14.1
  • NPM Version: 6.14.9
  • Yarn Version: 1.22.4

Strapi’s UI default Allowed File Types " in the advanced settings are not very granular – i.e. supporting images, videos, and files, but not specific file extensions (mimes) for each of these three types.

I wish to add additional granularity to the “files” filter to allow only specific mime types – e.g. allow only “.pdf” uploads.

Should I act on one of the approaches listed below to filter file uploads based on the specific extension type(s)?

  1. Creating a new Field in the administration panel?

  2. Add logic to the api/type/service.js file for my collection type?

  3. Clone and customize the code of the strapi-provider-upload-local?

  4. Other?

Thoughts?

Regards… Jim

1 Like

I second this. I’d like to limit uploads only to .svg files and nothing else. Is it possible?

1 Like

Yes. I also having the same issue. I need to limit the uploads to png and jpg nothing else. I also wanna know that the possibility. Thank you.