You need to sign in to do that
Don't have an account?
JeriMorris
How do I change the MIME type of a static resource?
I have a static resource that contains a style sheet. It's defined with <style type="text/css"> at the top.
When I upload the file for this resource, Salesforce creates it with a MIME type of text/plain. It doesn't pick up the MIME type from the file's contents. It doesn't let me specify the MIME type when I upload the file. There doesn't seem to be a way to change the MIME type of an existing static resource.
This is a problem because Firefox doesn't want to load a style sheet whose MIME type isn't text/css.
How can I define or change the MIME type of a static resource?
Thanks,
Jeri.
PS. If there was a better place to post this message, please let me know. Thanks!
When I upload the file for this resource, Salesforce creates it with a MIME type of text/plain. It doesn't pick up the MIME type from the file's contents. It doesn't let me specify the MIME type when I upload the file. There doesn't seem to be a way to change the MIME type of an existing static resource.
This is a problem because Firefox doesn't want to load a style sheet whose MIME type isn't text/css.
How can I define or change the MIME type of a static resource?
Thanks,
Jeri.
PS. If there was a better place to post this message, please let me know. Thanks!
Still, it seems like there ought to be a way to change the MIME type through the browser, rather than having to resort to the IDE. Is there?
Jeri.
Easiest way I've found to do it is with the developer console.
Open the developer console, click "Query Editor" at the bottom, then query:
SELECT Id, Name, ContentType FROM StaticResource
You can optionally add "WHERE Name = 'Your File Name'" if you're sure of the file. Check the "Use tooling API" box and click Execute. In the results that come up, double click the ContentType of the resource you want to change, type in your new value, then click Save Rows.
Enjoy your new mime type.
I'm using jquery datatable plugin in lightning component and struck with the following error:
"Refused to apply style from 'https://mynewphase-dev-ed.lightning.force.com/resource/DataTables%20(1)/DataTables-1.10.18/css/jquery.dataTables.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."
I tried to edit the ContentType through dev console as mentioned above, and still facing the same issue.
Are there any compatibility version differences regarding jquery datatable plugin for lightning components, please help in solving this issue.
Thanks in Advance!!