diff --git a/src/files/FilesPage.js b/src/files/FilesPage.js index 91e93f631..6b7869363 100644 --- a/src/files/FilesPage.js +++ b/src/files/FilesPage.js @@ -62,10 +62,17 @@ const FilesPage = ({ return downloadAbort() } - const updater = (v) => setDownloadProgress(v) const { url, filename, method } = await doFilesDownloadLink(files) - const { abort } = await downloadFile(url, filename, updater, method) - setDownloadAbort(() => abort) + + if (method === 'GET') { + const link = document.createElement('a') + link.href = url + link.click() + } else { + const updater = (v) => setDownloadProgress(v) + const { abort } = await downloadFile(url, filename, updater, method) + setDownloadAbort(() => abort) + } } const onDownloadCar = async (files) => { diff --git a/src/lib/files.js b/src/lib/files.js index 3ee57a3c4..b785a8ed9 100644 --- a/src/lib/files.js +++ b/src/lib/files.js @@ -54,7 +54,7 @@ async function downloadSingle (file, gatewayUrl, apiUrl) { filename = `${name}.tar.gz` method = 'POST' // API is POST-only } else { - url = `${gatewayUrl}/ipfs/${file.cid}` + url = `${gatewayUrl}/ipfs/${file.cid}?download=true&filename=${file.name}` filename = file.name method = 'GET' }