Download script / ajax no longer working


#1

I have been using this method to download files since V2 release. It worked fine even with 2019.0, but now will not with 2019.1.

No errors shown in PHP debug and no console errors.

$('#download').on('click', function () {
    		$.ajax({
    			url: 'download.php',
    			method: 'GET',
    			xhrFields: {
    				responseType: 'blob'
    			},
    			success: function (data) {
    				var a = document.createElement('a');
    				var url = window.URL.createObjectURL(data);
    				a.href = url;
    				a.download = 'rss.xml';
    				a.click();
    				window.URL.revokeObjectURL(url);
    			}
    		});
    	});

download.php

<?php
$storagelocation = exo_getglobalvariable('HEPubStorageLocation', '');
$xml_file = $storagelocation.'rss.xml';

header('Content-Description: File Transfer'); 
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($xml_file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($xml_file));
readfile($xml_file);
?>

@gdgsupport (or anyone) can you see anything that may cause not to work with 2019.1?

Now any project that I have to update, my downloads no longer work:(


#2

Try to disable the new https secure protocol to see if it helps (in PHP Settings page of ExeOutput).


#3

Already moved on to another solution. Needed to get software out to client. Will try that in future.