Skip to content
Snippets Groups Projects

Resolve "Set correct header when downloading multiple files"

1 file
+ 8
2
Compare changes
  • Side-by-side
  • Inline
@@ -125,6 +125,7 @@ async function downloadInChunks(
let rangeAndLength: RangeLength = { start: -1, end: -1, length: -1 };
downloadState.fileSize = 0;
downloadState.downloadedBytes = 0;
await objectRepository.fetchS3ObjectMeta(bucket, key);
while (!isComplete(rangeAndLength)) {
const nextRange: Range = {
start: rangeAndLength.end + 1,
@@ -138,10 +139,15 @@ async function downloadInChunks(
);
}
try {
const metaKey = bucket + "/" + key;
const response = await getObjectRange(
bucket,
key,
nextRange,
objectRepository.objectMetaMapping[metaKey]?.ContentLength !=
undefined &&
objectRepository.objectMetaMapping[metaKey]?.ContentLength < PART_SIZE
? undefined
: nextRange,
abortController,
);
if (response.Body != undefined) {
@@ -394,7 +400,7 @@ const enableDownload = typeof window.showDirectoryPicker === "function";
:disabled="!enableDownload"
@click="downloadFiles()"
>
Save
Download
</button>
<button
v-else
Loading