This issue is caused by the extra space you have at the end of your assets/functions.php file.
You have added that file to your connections file, so once you add a connection, it gets added as well.
The extra space is written to the page before the download and corrupts the download file. If you remove that space the download will function properly.