diff --git a/src/common/Download/DownloadItem.js b/src/common/Download/DownloadItem.js index 062ea6a59..2806eaf4c 100644 --- a/src/common/Download/DownloadItem.js +++ b/src/common/Download/DownloadItem.js @@ -103,12 +103,12 @@ const DownloadItem = ({ downloadItem }) => { response = await api.getArtifactPreview(downloadItem.projectName, config) if (response?.data) { - fullFile = new Blob([fullFile, response.data], { type: response.data.type }) + fullFile = new Blob([fullFile, response.data]) } else { throw new Error('Error during loading the file') } - config.params.offset += chunkSize + config.params.offset += response.data.byteLength ?? chunkSize } response.data = fullFile diff --git a/src/utils/getArtifactPreview.js b/src/utils/getArtifactPreview.js index 39d9341bf..4b0832272 100644 --- a/src/utils/getArtifactPreview.js +++ b/src/utils/getArtifactPreview.js @@ -243,7 +243,7 @@ export const fetchArtifactPreview = async ( throw new Error('Error during loading the preview file') } - config.params.offset += chunkSize + config.params.offset += response.data.size ?? chunkSize } response.data = fullFile