Home > Enterprise >  D3.js Error: Failed to load resource: the server responded with a status of 406 (Not Acceptable)
D3.js Error: Failed to load resource: the server responded with a status of 406 (Not Acceptable)

Time:09-19

I have D3.js barchart published in IIS however, calling d3.csv function causes the following error:

GET http://localhost/D3JS/barchartCopy/Shipping.csv 406 (Not Acceptable)

this is the code:

$(document).ready(function () {
         d3.csv('http://localhost/D3JS/barchartCopy/Shipping.csv', function(data) {
    render(data);
    });

has anyone come across something like this?!

Edit:

I think the issue is related to some Http header, that should be included in function call!

CodePudding user response:

Thanks to Rory! you brought my attention to IIS.

I need to change the MIME Types in the application node in IIS.

IIS --> website --> MIME Types

change .csv MIME Type from --> application/octet-stream to --> text/csv

Reload the application pool.

and this fixed the issue.

  • Related