Problems downloading big file(max 15 mb) on google chrome
<p>I have a downloading problem in Google Chrome.
I am using Ruby 2.2, Rails 4.2, AngularJS 1.2.</p>

<p>We dont have a database here. Everything we are getting through API. The file which we are trying to download is around 7 mb. It gives us "Failed: Network Error". Though it works fine on Firefox.</p>

<p>From the API we are getting binary data in JSON. We are parsing it. And then: </p>

<pre><code>send_data response_fields["attachment"], type: response_fields["mimeType"], disposition: 'attachment', filename: params[:filename]
</code></pre>

<p>As we are using AngularJS, we are catching that value in AngularJS Controller and then converting it as: </p>

<pre><code>var str = data;
var uri = "data:" + mimeType + ";base64," + str;

var downloadLink = document.createElement("a");
downloadLink.href = uri;
downloadLink.download = filename;
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
</code></pre>

<p>This works in Firefox &amp; even Chrome for smaller file size. Not sure why it is giving error for bigger size on Chrome.</p>

<p>Any suggestions?</p>

<p>Thanks.</p>