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:(