我试图以zip方式下载文件 . 我发送ajax请求,作为回应我想发送一个zip文件 . 但我得到错误 . 我的ajax请求如下

$( "#test-id" ).on( "click", function() {
    $.ajax({
        type: "GET",
        url: "<%= articles_download_path %>",
        dataType:"application/zip",
        success: function (result) {
           window.alert("success!!");
        },
        error: function (){
            window.alert("something wrong!");
        }
    });
});

和我的下载动作

def download    
    @articles = Article.all

    respond_to do |format|
      format.zip{
        send_data(Article.zip_all_articles, :type => 'application/zip', :filename => 'articles.zip')
      }
    end    
  end

我的日志中没有错误,但在我的浏览器控制台中给出了这样的响应

PK����8dJH�/���
��������after upgrade 30.xlsx�W8\��u�0�(�A��Q��-!zDI0:3�^B�%����D��Ddt!z�������e�{�s�9��g
���W�k���I@H��H�Ǫ����V����c�n0'�����0��n�"|CF��Q��I&������C�ʘo�q��ke�XڑPJ�잝L5aNhlv�eU   V�D
ʟK�]����E�0Ё���s�9\�!��[RYqR%Ke�K���%5^�

和我的日志

Started GET "/articles/download?locale=en" for 127.0.0.1 at 2016-02-10 12:33:48 +0100
Processing by ArticlesController#download as */*
  Parameters: {"locale"=>"en"}
.
.
.
 Rendered text template (0.0ms)
Sent data articles.zip (1.0ms)
Completed 200 OK in 431ms (Views: 1.0ms | ActiveRecord: 5.0ms)

我认为我的zip文件的ajax请求格式不正确 . 但我通过搜索互联网找不到任何其他东西 . 如何解决这个问题?