Module

x/drash/mod.ts>Response#file

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
method Response.prototype.file
import { Response } from "https://dotland.deno.dev/x/drash@v2.7.0/mod.ts";

Set the body of this response as the contents of the given filepath. The Content-Type header will be set automatically based on the extension of the filepath.

Parameters

filepath: string
  • The filepath of the file to download, relative to the CWD that executed the entrypoint script.
optional
status: number
  • The status to respond with. Default on the response is 200.
optional
headers: Record<string, string> = [UNSUPPORTED]
  • Any extra headers you wish to specify apart of the content-type header