none
SharePoint-hosted CSS files are loaded as application/octet-stream RRS feed

  • Question

  • I have an issue with loading external CSS file on SharePoint page in SharePoint 2019.

    <link rel="stylesheet" type="text/css" href="..." />

    When the file is loaded to the page the Response Header contains 

    Content-Type:
    application/octet-stream

    instead of Content-Type: text/css

    The problem with that is as result the styles are not applied on the page.

    Full Response Header Source:

    HTTP/1.1 200 OK
    Cache-Control: private,max-age=0
    Content-Type: application/octet-stream
    Expires: Mon, 22 Oct 2018 00:41:55 GMT
    Last-Modified: Mon, 05 Nov 2018 23:30:37 GMT
    Accept-Ranges: bytes
    ETag: "{407896D7-5097-40FC-9474-9BB7C62FF8BC},7"
    Server: Microsoft-IIS/10.0
    X-SharePointHealthScore: 1
    ResourceTag: rt:407896D7-5097-40FC-9474-9BB7C62FF8BC@00000000007
    Content-Dis; filename*=utf-8''simple%2dcss%2ecss; filename="simple-css.css"
    X-Download-Options: noopen
    Public-Extension: http://schemas.microsoft.com/repl-2
    SPRequestGuid: 4d8a9f9e-3b59-107e-95ed-db92e060bb38
    request-id: 4d8a9f9e-3b59-107e-95ed-db92e060bb38
    X-FRAME-OPTIONS: SAMEORIGIN
    SPRequestDuration: 239
    SPIisLatency: 66
    X-Powered-By: nosniff
    MicrosoftSharePointTeamServices: 16.0.0.10337: 1; RequireReadOnly
    Date: Tue, 06 Nov 2018 00:41:55 GMT
    Content-Length: 31910

    I've tried to upload the css both to Style Library and Master Page Gallery - no difference.

    IIS MIME type settings are correct.

    I have a single-farm environment with Windows Server 2016, SQL Express 2016 and SharePoint 2019.

    P.S.: SharePoint 2013, SharePoint 2016 and Online work as expected.

    Tuesday, November 6, 2018 12:48 AM

Answers

All replies

  • Is this a modern team or communications site or classic site template?

    Trevor Seward

    Office Servers and Services MVP



    Author, Deploying SharePoint 2016

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Tuesday, November 6, 2018 1:27 AM
  • This is something we are aware of an looking into.  Are you able to workaround the issue by storing the CSS on the local disk and referencing the local file from the master page? Also keep in mind that the modern sites dos not use a master page. So any customizations that require a master page will only work with classic sites.

    Regards,


    Mike Lee

    Tuesday, November 6, 2018 1:53 PM
  • Modern Team Site
    Tuesday, November 6, 2018 5:06 PM
  • Hi Mike,

    I can workaround with referencing CSS from CDN (I mean I've tested that and it works). But it doesn't solve the issue for me in current situation for many reasons...

    And thanks for mentioning Master Pages - I'm not using them. I'm using ScriptLink Custom action for Classic and Application Customizer for Modern.

    Tuesday, November 6, 2018 5:09 PM
  • This bug was present in the SP 2019 preview.

    I sent a feedback on the Preview forum. MS replied that they were aware of the issue but no action and the bug is still there in the RTM.

    Sadly

    Wednesday, November 7, 2018 7:51 AM
  • Hi Mike,

    We are having this issue with publishing site template. All custom CSS files are returned as application/octet-stream and master page not rendered correctly.

    When is the fix going to be released?


    pinster

    Friday, November 16, 2018 8:11 AM
  • Hi all,

    We don't have this issue in our SP 2019 Preview or in SP 2019 RTM environment. One of our clients though is having this exact same issue atm (css served as application/octet-stream from Style Library). Is there still sometihng missing from the picture? Why doesn't this behavior occur in every environment? Would anyone have an answer?

    Tuesday, November 20, 2018 11:25 AM
  • This is a known issue and we are working on a fix. As a workaround the CSS files can be stored in a static path outside of SharePoint. Once we have an update for this issue, I will post it here.


    Mike Lee

    Tuesday, November 20, 2018 3:01 PM
  • I think the suggested workaround to serve files from static location is not suitable because some of SharePoint's assets are also loaded from Style Library and we see the "Resource interpreted as Stylesheet but transferred with MIME ... type application/octet-stream" for at least Themable/Core Styles/pagelayouts15.css and Themable/Core Styles/controls15.css.

    Waiting for a fix.
    Wednesday, November 21, 2018 12:36 PM

  • A workaround / solution has been found for this issue. In an environment styles were loaded as octect-stream, IIS 6 Features were installed on the server via Servere Manager / Add Roles & Features and more specifically "IIS 6 Metabase Compatibility (Web-Metabase)". After installing the missing feature, the problem went away. So the feature is required and in some cases not installed. 

    • Proposed as answer by Mike Lee [MSFT] Thursday, November 29, 2018 1:48 PM
    • Marked as answer by Alex Terentiev Thursday, November 29, 2018 6:23 PM
    Wednesday, November 28, 2018 3:05 PM
  • See here for details about this issue:

    https://blogs.technet.microsoft.com/stefan_gossner/2018/11/30/common-issue-sp2019-items-in-document-libraries-are-downloaded-with-mime-type-application-octet-stream-rather-than-the-accurate-one/


    Stefan Goßner Senior Escalation Engineer - Microsoft Support Services This post is provided "AS IS" with no warrenties and confers no rights.

    Friday, November 30, 2018 1:19 PM
  • Thank you Stefan, just wondering if the hot fix mentioned in the link has been completed? We are facing this same issue in the new SharePoint 2019 farm we just completed installing.
    Thursday, January 24, 2019 1:24 PM
  • the issue is fixed in update KB4464556

    Wednesday, May 29, 2019 10:03 AM
  • Is it? I cannot see any information about that in that KB. I have a customer with this problem and I have applied KB4464556 in the farm. The problem remain.

    BR

    Johan

    Tuesday, June 4, 2019 8:00 AM
  • No, the fix is not included in that PU.

    Trevor Seward

    Office Servers and Services MVP



    Author, Deploying SharePoint 2016

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Tuesday, June 4, 2019 2:46 PM
  • The fix is scheduled to be included in July 2019 CU.

    Stefan Goßner Senior Escalation Engineer - Microsoft Support Services This post is provided "AS IS" with no warrenties and confers no rights.

    Tuesday, June 4, 2019 9:34 PM
  • it is not fixed with the July 2019 CU;  just tested it.  what an idiotic problem to have been around for over a year. 

    Steve

    Tuesday, August 13, 2019 3:30 PM
  • Hi Steve, I just tested the July 2019 Public Update for SharePoint Server 2019 and confirmed that CSS files hosted in SharePoint are now being downloaded with the correct "text/css" content type.  If you're still having issues you may want to open a support case with Microsoft Support so they can help you figure out what's unique about your environment.

    - Troy Starr [MSFT]

    Tuesday, August 13, 2019 6:10 PM