Can force file download

This commit is contained in:
2025-05-01 19:09:43 +02:00
parent 40cf0c16df
commit cfbc003737
3 changed files with 51 additions and 26 deletions

View File

@ -41,7 +41,10 @@ export class FileApi {
/**
* Get a file download URL
*/
static DownloadURL(file: UploadedFile): string {
return APIClient.backendURL() + `/file/${file.id}/download`;
static DownloadURL(file: UploadedFile, forceDownload = false): string {
return (
APIClient.backendURL() +
`/file/${file.id}/download${forceDownload ? "?download=true" : ""}`
);
}
}