Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/opine/src/response.ts>Response#download

Fast, minimalist web framework for Deno ported from ExpressJS.
Very Popular
Go to Latest
method Response.prototype.download
import { Response } from "https://deno.land/x/opine@2.2.0/src/response.ts";

Transfer the file at the given path as an attachment.

Optionally providing an alternate attachment filename.

Optionally providing an options object to use with res.sendFile().

This function will set the Content-Disposition header, overriding any existing Content-Disposition header in order to set the attachment and filename.

This method uses res.sendFile().

Parameters

path: string
optional
filename: string
optional
options: any

Returns

Promise<this | void>