0


I want to download a gz file using ajax but didn't work.

Here What I get:

x1H4sIAAAAAAAAC82dzW8bORLF7/orGsjBNuAATRaL/THIwZMou8Y6diDLi52T7djajbDxB2xlFvPfL4u0I42cKP0uTwMEOcxI8c9sVr1ikY/9avSqmh78ejSuTqeTs7fTs8m4en8y6avLq8X89...

AJAX:

                $.ajax({
                    type: 'POST',
                    url: base_url+'backups/create',
                    data: $(form).serialize(),
                    dataType: 'json',
                    cache: false,
                    success: function (data) {

                    }
                });
  • Possible duplicate of [Handle file download from ajax post](https://stackoverflow.com/questions/16086162/handle-file-download-from-ajax-post) – Matt S Oct 02 '18 at 13:50
  • Possible duplicate of [Fetching zipped text file and unzipping in client browsers, feasible in Javascript?](https://stackoverflow.com/questions/14727856/fetching-zipped-text-file-and-unzipping-in-client-browsers-feasible-in-javascri) – Cinn Oct 02 '18 at 13:54
  • you can't download any kind of file using AJAX - it always ends up as a variable inside your JavaScript, instead of on the user's disk. You need to rethink your approach. – ADyson Oct 02 '18 at 14:47

0 Answers0