diff --git a/Webserver/src/routes/image/+page.svelte b/Webserver/src/routes/image/+page.svelte index 24d5f32..4804429 100644 --- a/Webserver/src/routes/image/+page.svelte +++ b/Webserver/src/routes/image/+page.svelte @@ -10,6 +10,12 @@ let imageURL: string | null, lastImage: File; let uploadData: UploadData; + async function sendImage(url: string) { + const fdata = new FormData(); + fdata.append('url', url); + await post(fdata, 'upload'); + } + async function fileAsDataURL(file: File, width: number, height: number): Promise { return new Promise((resolve, reject) => { const img = new Image(); @@ -73,8 +79,13 @@ {#await fileAsDataURL(lastImage, 192, 192)}

Loading image data . . .

{uploadData.elapsed} seconds elapsed.

- {:then} -

Done!

-

{uploadData.elapsed} seconds elapsed.

+ {:then dataUrl} + {#await sendImage(dataUrl)} +

Sending image . . .

+

{uploadData.elapsed} seconds elapsed.

+ {:then} +

Done!

+

{uploadData.elapsed} seconds elapsed.

+ {/await} {/await} {/if}