2

Configured in the project to load "fontawesome.min.css" from the local project folder instead of from CDN. Followed the below steps and configuration, now getting 415 Unsupported Media type.

  1. Downloaded the font-awesome-4.7.0.zip file from here

  2. Extracted it to the local project

  3. updated the html file to load the "fontawesome.min.css" file from local instead from CDN

  4. After that, now getting 415 (Unsupported Media Type)

.../font-awesome/fonts/fontawesome-webfont.woff2?v=4.7.0 net::ERR_ABORTED 415 (Unsupported Media Type)

Referrer: .../font-awesome/css/font-awesome.min.css

Original code:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/fontawesome.min.css">
       
Updated code:
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">

The invoking code from

"fontawesome.min.css" is enter image description here

DAIRAV
  • 723
  • 1
  • 9
  • 31
  • 1
    You may need to download those files relative to fontawesome on the cdn – Steve Tomlin Mar 21 '23 at 06:08
  • @SteveTomlin yes I have downloaded the full folder of "font-awesome-4.7.0.zip" – DAIRAV Mar 21 '23 at 06:50
  • 1
    You may need to [configure your web server to serve `woff2` files](https://stackoverflow.com/q/28235550/2518285). – Brett Donald Mar 21 '23 at 06:52
  • Please show the CSS code calling the WOFF2 font. (the fontawesome.min.css is only the first step to tell where to load the font from.) – dodrg Mar 25 '23 at 12:42
  • @dodrg url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), – DAIRAV Mar 27 '23 at 09:11
  • @dodrg -----@font-face { font-family: 'FontAwesome'; src: url('../fonts/fontawesome-webfont.eot?v=4.7.0'); src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; } – DAIRAV Mar 27 '23 at 09:12
  • 1
    @DAIRAV Well, that's part of the `fontawesome.min.css` we already have seen. I hoped to see the `font-family` assignment. — Which webserver do you use apache / nginx / iis? – dodrg Mar 27 '23 at 09:31
  • @DAIRAV Use as per reference https://fontawesome.com/v6/docs/web/setup/host-yourself/webfonts without min.css as you are using local machine(development), check if the issue is resolved. Check server config is also important. – dig99 Mar 29 '23 at 08:11

1 Answers1

1

The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format.

web.config:

<system.webServer>
  <staticContent>
    <remove fileExtension=".woff2" />
    <mimeMap fileExtension=".woff2" mimeType="font/woff2" />
  </staticContent>
</system.webServer>
Parth M. Dave
  • 853
  • 1
  • 5
  • 16