Can upload ISO files
This commit is contained in:
21
virtweb_frontend/src/api/IsoFilesApi.ts
Normal file
21
virtweb_frontend/src/api/IsoFilesApi.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { APIClient } from "./ApiClient";
|
||||
|
||||
export class IsoFilesApi {
|
||||
/**
|
||||
* Upload a new ISO file to the server
|
||||
*/
|
||||
static async Upload(
|
||||
file: File,
|
||||
progress: (progress: number) => void
|
||||
): Promise<void> {
|
||||
const fd = new FormData();
|
||||
fd.append("file", file);
|
||||
|
||||
await APIClient.exec({
|
||||
method: "POST",
|
||||
uri: "/iso/upload",
|
||||
formData: fd,
|
||||
progress: progress,
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user