The bold line above is the one that isn't working and I'm trying to get figured out. Here is the relevant HTML and javascript for that piece:
<button type="button" class="btn btn-primary" id="transform"> <span class="glyphicon glyphicon-wrench"></span> Transform Uploaded Files </button> <a id="test_dl" href="" download="user_download.zip"> Download File </a> $('#transform').click(function (e) { $.getJSON('/transform', {}, function (final_zip){ var zipfile = "file://" + final_zip.zip_filename $('a#test_dl').attr("href", zipfile) }); });
The user clicks the "Transform Uploaded Files" button, which then updates the href to the resulting zipfile location and then is able to download the resulting package by clicking on the "Download File" HTML.
I've tested this in Chrome so far and using the developer console I'm able to see that the href is being updated properly prior to clicking on the download button, but it always gives a "Failed - Network Error" dialog. What's odd is that when I click on "Show All Downloads" and then click on the failed download, it completes successfully.
Edit: I should add that the backend for this is currently running on Python's Flask
Restart your device. Open your Settings app and tap Network & internet or Connections. Depending on your device, these options may be different. Turn Wi-Fi off and mobile data on, and check if there's a difference. If not, turn mobile data off and Wi-Fi on and check again.
This error is known to be caused by Security Software, Browser Extension/Plugins or due to certain Apps and programs, preventing Chrome browser from downloading files on your computer. In certain cases, the problem can also be caused due to presence of Malware and Rogue Adware programs on your computer.
Apparently this is a Chrome issue with the data-URL getting too long. I'm still working through it myself, but there apparently are some solutions involving Blob-objects.
See here: Download Canvas as PNG in fabric.js giving network Error
And here: How to export JavaScript array info to csv (on client side)?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With