KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Assuming a server which cannot zip responses to user requests. A web developer nevertheless creates a myfile.txt.gz and stores it at http://www.mysite.com/myfile.txt.gz . It is possible to have the browser automatically gunzip this compressed text file as part of the Ajax request and store the result in a var ? If yes, how? I am open to other compression algorithms if necessary. Update I am trying to use the following JQuery Ajax call: var fetch = function() { $.ajax({ type: 'GET', url: "./data.txt.gz", headers: { "Accept-Encoding" : "gzip" }, dataType: "text", async: true, success: function(result) { $("#midEnglob").text(result); }, error: function(jqXHR, textStatus, errorThrown) { alert("Issue: " + textStatus + " " + errorThrown + " !"); } }); } but I get the following in my browser: Any ideas?
Tags (comma-separated)
Save Edits
Cancel