deno.land / x / abc@v1.3.3 / examples / file_upload / main.ts
12345678910111213141516171819import type { FormFile } from "../../vendor/https/deno.land/std/mime/multipart.ts";import { Application } from "../../mod.ts";
const decoder = new TextDecoder();
const app = new Application();
app.start({ port: 8080 });
console.log(`server listening on http://localhost:8080`);
app.post("/file", async (c) => { const { file } = await c.body as { file: FormFile }; return { name: file.filename, content: decoder.decode(file.content), };});
Version Info