Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
class MultipartWriter
import { MultipartWriter } from "https://deno.land/std@0.94.0/mime/multipart.ts";

Writer for creating multipart/form-data

Constructors

new
MultipartWriter(writer: Deno.Writer, boundary?: string)

Properties

private
readonly
_boundary: string
private
bufWriter: BufWriter
private
isClosed: boolean
private
lastPart: PartWriter | undefined
readonly
boundary: string

Methods

private
createPart(headers: Headers): Deno.Writer
private
flush()

Close writer. No additional data can be written to stream

createFormField(field: string): Deno.Writer
createFormFile(field: string, filename: string): Deno.Writer
writeField(field: string, value: string)
writeFile(
field: string,
filename: string,
file: Deno.Reader,
)