Client download of a server generated zip file

后端 未结 4 1061
傲寒
傲寒 2020-12-16 21:17

Before somebody says, \"duplicate\", I just want to make sure, that folks know, that I have already reviewed these questions:

1) Uses angular and php, not sure what

4条回答
  •  忘掉有多难
    2020-12-16 21:48

    I updated my bulkdownload method to use $window.open(...) instead of $http.get(...):

    function bulkdownload(titles){
        titles = titles || [];
        if ( titles.length > 0 ) {
            var url = '/query/bulkdownload?';
            var len = titles.length;
            for ( var ii = 0; ii < len; ii++ ) {
                url = url + 'titles=' + titles[ii];
                if ( ii < len-1 ) {
                    url = url + '&';
                }
            }
            $window.open(url);
        }
    };
    

    I have only tested this in IE11.

提交回复
热议问题