Can download ISO files

This commit is contained in:
2023-09-06 16:57:38 +02:00
parent 8f65196344
commit fbe11af121
8 changed files with 222 additions and 19 deletions

View File

@ -20,7 +20,7 @@ export class IsoFilesApi {
method: "POST",
uri: "/iso/upload",
formData: fd,
progress: progress,
upProgress: progress,
});
}
@ -47,6 +47,24 @@ export class IsoFilesApi {
).data;
}
/**
* Download an ISO file
*/
static async Download(
file: IsoFile,
progress: (p: number) => void
): Promise<Blob> {
return (
await APIClient.exec({
method: "GET",
uri: `/iso/${file.filename}`,
downProgress(e) {
progress(Math.floor(100 * (e.progress / e.total)));
},
})
).data;
}
/**
* Delete iso file
*/