Wrong CSS MIME type
Hi,
The following problem happens with Sitefinity 4.1 SP1.
Steps to reproduce:
- I upload a CSS file from the backend, through Content / Document & Files
- I retrieve the link to this file
- I go and edit a page, go to "Scripts and Styles" on the right, drop a "CSS" element on the page
- I edit the CSS element to paste the CSS URL I copied earlier
- I publish the page
Result: with IE (tried IE6 and IE8), the CSS is applied. With Firefox (and probably other browsers), it isn't applied. From the HTML sources, I can see the CSS file is called in head, through a link element, and the URL is right, but the style is still not applied with Firefox. Looking at the Firefox error console, I see: "Error: The stylesheet blabla/style.css was not loaded because its MIME type, "application/octet-stream", is not "text/css"."
Is this problem known?
Thanks.
Hi Thomas,
How do you retrieve the url of the uploaded css file? Please note when a file is uploaded trough Sitefinity backend it is stored in the database. To use the css file you want place it in the Sitefinity directory or preferably in App_Themes and browse for it the URL to it is relative "~/App_Data/Sitefinity/WebsiteTemplates/YourTemplate/App_Themes/css/". Reference your css files by placing them in your Sitefinity webapp folders.
I hope this information helps.
Kind regards,
Stanislav Velikov
the Telerik team
Hi Stanislav,
I wanted to be able to upload the CSS file from the backend so I (and others) do not have to redeploy / update the site when we want to touch up the CSS. I have no doubt that it'd work if I included it in the site project. To retrieve the URL, I simply click "Embed link to this file" under "Documents & Files". The URL is definitely right, else it wouldn't work with IE, and wouldn't give this error with Firefox.
I think Sitefinity could automatically serve the right content type (and possibly let the admin override it by defining another content type).
Edit: I guess I should upload my files through Administration / Files instead.
Hello Thomas,
Thank you for getting back to me.
Request for uploading files on the file system is logged in PITS and planned for Q2.
As a solution, you could use built-in Document Manager provided by RadEditor. To achieve this, you need to map a template of the RadEditor and modify as described in this forum thread and save your css to a specific folder and then reference and use them.
Greetings,
Stanislav Velikov
the Telerik team