-
Fabien Amarger authoredFabien Amarger authored
utils.ts 364 B
export function openFile(file?: Blob) {
if (file) {
const url = URL.createObjectURL(file);
window.open(url);
} else {
console.warn("No file available either locally or on the server");
}
}
export async function downloadFile(url: string) {
const response = await fetch(url, {
credentials: "include",
});
return await response.blob();
}