Skip to content

Instantly share code, notes, and snippets.

@javiergarciad
Forked from ymdx/index.js
Created May 26, 2023 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javiergarciad/1318acdd3edc892c03ca21f2e7a7c3ef to your computer and use it in GitHub Desktop.
Save javiergarciad/1318acdd3edc892c03ca21f2e7a7c3ef to your computer and use it in GitHub Desktop.
How to download CSV File from HttpResponse with Ajax
success: function(data) {
var blob=new Blob([data]);
var link=document.createElement('a');
link.href=window.URL.createObjectURL(blob);
link.download="<FILENAME_TO_SAVE_WITH_EXTENSION>";
link.click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment