Page MenuHomeSealhub

uploaded-files.ts
No OneTemporary

uploaded-files.ts

import Router from "@koa/router";
import File from "../../data-structures/file";
const uploaded_files = new Router();
uploaded_files.get("/:id/:filename", async (ctx) => {
const file = await File.fromID(ctx.$app, ctx.params.id);
ctx.body = file.getStream();
// removing this as it only created trouble and you can declare download
// target in html <a> element, anyway
// ctx.set(
// "Content-Disposition",
// `attachment; filename*=utf-8''="${encodeURIComponent(file.filename)}"`
// );
});
export default uploaded_files;

File Metadata

Mime Type
text/x-java
Expires
Wed, Aug 13, 17:15 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
870323
Default Alt Text
uploaded-files.ts (534 B)

Event Timeline