--- title: "Get a file with an ajax call" layout: default section: example ---

With JSZipUtils

Note: JSZipUtils is a library available here.
{% include_relative get-binary-files-ajax.inc/jszip_utils.html %}
{% highlight js %} {% include_relative get-binary-files-ajax.inc/jszip_utils.js %} {% endhighlight %}
{% highlight html %} {% include_relative get-binary-files-ajax.inc/jszip_utils.html %} {% endhighlight %}

With the Fetch API

Note: the Fetch API is a new javascript API which may not be available everywhere.
{% include_relative get-binary-files-ajax.inc/fetch_api.html %}
{% highlight js %} {% include_relative get-binary-files-ajax.inc/fetch_api.js %} {% endhighlight %}
{% highlight html %} {% include_relative get-binary-files-ajax.inc/fetch_api.html %} {% endhighlight %}