0

I am trying to generate URL on users selection for download purpose. If user selects more than 1000 files the url does not work in IE as URL limitation of 2052 chars

Any other solution to get it worked in IE

As less files are selected it opens in new tab and after download starts it closes that window

but same think i do this with form submit in new TAB then TAB does not get close after download starts

So anyone can provide me the solution

below is my code:

    <a target="_blank" id="abc" onclick="download()">
    <script>
        function download(){
        var dataUrl="URL/download"
            var paths=[];
            for(var k = 0; k < len; k++) {
                    $cur = $list[k];
                    paths.push(JSON.parse($($cur).attr('json-data')));
              }
              dataurl += "&path=" + paths + "&fetchurl=1";
              $('#abc').attr('href', dataurl);
        }
    </script>
pareshm
  • 4,874
  • 5
  • 35
  • 53
  • 1
    That is normal, see here https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers – Henry Jun 23 '17 at 07:40
  • Possible duplicate of [What is the maximum length of a URL in different browsers?](https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers) – freedomn-m Jun 23 '17 at 07:41
  • I think you can switch to ajax post approach. GET always limits URL length. POST is for large data to be passed. You can read more [here](https://stackoverflow.com/questions/16086162/handle-file-download-from-ajax-post) – Andrius Jasiukevičius Jun 23 '17 at 07:51
  • above comments does not solve my problem if i submit form with data and if some error occurs it will break my existing UI screen if i submit in form opening new tab it download but it will not close that tab after download – pareshm Jun 23 '17 at 09:44

0 Answers0