Interface File

Object containing file metadata and access information.

interface File {
    buffer: Buffer;
    destination: string;
    encoding: string;
    fieldname: string;
    filename: string;
    mimetype: string;
    originalname: string;
    path: string;
    size: number;
    stream: Readable;
}

Properties

buffer: Buffer

MemoryStorage only: A Buffer containing the entire file.

destination: string

DiskStorage only: Directory to which this file has been uploaded.

encoding: string

Value of the Content-Transfer-Encoding header for this file.

Deprecated

since July 2015

See

RFC 7578, Section 4.7

fieldname: string

Name of the form field associated with this file.

filename: string

DiskStorage only: Name of this file within destination.

mimetype: string

Value of the Content-Type header for this file.

originalname: string

Name of the file on the uploader's computer.

path: string

DiskStorage only: Full path to the uploaded file.

size: number

Size of the file in bytes.

stream: Readable

A readable stream of this file. Only available to the _handleFile callback for custom StorageEngines.

Generated using TypeDoc