title: Request URL Too Long
body: <p>I getting this error "<strong>Request URL Too Long</strong>" when i tried to download the file. The url shows the data that i want to download but it doesn't download. </p>
  
  <p>How can i solve <strong>Request URL Too Long</strong> error when downloading</p>
  
  <p>my code</p>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code> &lt;script&gt;
                      function DownloadIndexController(possID) {
                          $.ajax({
                              url: '@Url.Action("DownloadIndex", "Poss")',
                              contentType: 'application/json; charset=utf-8',
                              datatype: 'json',
                              data: { possID: possID },
                              type: "GET",
                              success: function (returnValue) {
  
                                  window.location = '/DownloadIndex/Poss' + returnValue;
                              }
                          })
                      }
              &lt;/script&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>  [HttpGet]
      public virtual ActionResult DownloadIndex(int possID)
      {
          try
          {
              possFilename = possFilename.Replace(",", ",");
              string fullPath = Filelocation + possFilename;
              return File(fullPath,  System.Net.Mime.MediaTypeNames.Application.Octet, possFilename);
  
          }
          catch (Exception ex)
          {
              throw ex;
          }
  </code></pre>