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

x/deno/std/mime/multipart.ts>MultipartWriter

A modern runtime for JavaScript and TypeScript.
Go to Latest
class MultipartWriter
import { MultipartWriter } from "https://deno.land/x/deno@v0.28.0/std/mime/multipart.ts";

Writer for creating multipart/form-data

Constructors

new
MultipartWriter(writer: 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): Writer
private
flush(): Promise<void>
close(): Promise<void>

Close writer. No additional data can be writen to stream

createFormField(field: string): Writer
createFormFile(field: string, filename: string): Writer
writeField(field: string, value: string): Promise<void>
writeFile(
field: string,
filename: string,
file: Reader,
): Promise<void>