Using a different content type for files

Learn how to override the content type gatsby-plugin-s3 sets on your files.

By default, the mime module is used to automatically map file extensions to a mime type.
If you're finding your files get served with a incorrect content type, you can simply use the params field in the configuration to override this:

params: {
    '*.pdf': {
        ContentType: 'application/x-pdf'

Remember: params that are configured by you will always override params that the plugin itself sets.


Hey! 👋 Was this page helpful?

We're always looking to make our docs better, please let us know if you have any suggestions or advice about what's working and what's not!

© Jari Zwarts 2020