Hey,
I'm trying to download a PDF file by creating a Blob link for the data received from a server.
Chrome for Android shows 'downloading...' and then shows the error message '{file-name} download failed due to an unknown error'. But when I go to downloads in Chrome for Android, the file is listed there and opens as well.
I have the same issue with 58.* version of chrome on my Nexus 5X. This is the code that tells the browser to download a file as a blob:
function saveBlob (blob: Blob, name: string): void {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = name;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
a.remove();
};
On desktop Chrome, this code works nicely but on mobile not.
Currently, I've tried 58, 59 and 60 mobile version of Chrome and it does not work there with the error mentioned above: "{file_name} download failed due to an unknown error".
I've tried an older version of Chrome mobile (53) and it works there.
Did anyone else have a similar issue?
Cheers,
Tomek