UNPKG

@nestjs/platform-fastify

Version:

Nest - modern, fast, powerful node.js web framework (@platform-fastify)

25 lines (24 loc) • 933 B
import type { IncomingMultipartFile, MultipartStorageEngine } from '../interfaces/index.js'; type NameCallback = (error: Error | null, value: string) => void; type NameResolver = (req: any, file: IncomingMultipartFile, callback: NameCallback) => void; /** * @publicApi */ export interface DiskStorageOptions { /** * The folder files are written to (Default: `os.tmpdir()`). A string is * created when the storage engine is; a function must return a folder that * already exists. */ destination?: string | NameResolver; /** The file name within `destination` (Default: 32 random hex characters, no extension). */ filename?: NameResolver; } /** * Writes each file to disk, with multer's `diskStorage` defaults and file * shape (`destination`, `filename`, `path`, `size`). * * @publicApi */ export declare function diskStorage(options?: DiskStorageOptions): MultipartStorageEngine; export {};