0

I am trying load a large dataset into d3.js by compressing files as gzip, and specifying the "Content-Encoding:gzip" in the request header. The browser doesn't seem to uncompress the gzip file as it is supposed to do. I created jsfiddle containing a simple example here.

d3.text("https://dl.dropboxusercontent.com/s/335n5iyhqlx1m3k/exmaple.txt.gz", function(error, text) {
    console.log("compressed: ",text)
}).header("Content-Encoding", "gzip");

What am I doing wrong here?

ahmohamed
  • 2,920
  • 20
  • 35
  • I think the content encoding is only applied to the HTTP packages content, see [HTTP compression](http://en.wikipedia.org/wiki/HTTP_compression). From my understanding, it doesn't decrompress a whole file after receiving. – Imperative Aug 14 '14 at 08:16
  • If so, then how can I uncompress the whole file? – ahmohamed Aug 14 '14 at 09:11
  • [this](http://stackoverflow.com/questions/294297/javascript-implementation-of-gzip) might help you getting started – Imperative Aug 14 '14 at 11:05

0 Answers0