Skip to main content
The BufferedFile class provides information about uploaded files and saves files using the saveToDisk() method.

BufferedFile Overview

File Info

filename, mimetype, size extname, md5

saveToDisk()

Save to storage Auto URL generation

buffer

Buffer access .buffer getter

URL Properties

url, signedUrl Auto-set after saving

Basic Properties

File Information

Property List:
  • filename: string - Original filename
  • mimetype: string - MIME type
  • size: number - File size (bytes)
  • extname: string | false - Extension (without dot)
  • url: string | undefined - Public URL after saving
  • signedUrl: string | undefined - Signed URL after saving

saveToDisk() Method

Basic Usage

Save to Specific Disk

buffer Getter

buffer Property

.buffer is a getter that returns the pre-loaded Buffer from multipart parsing.

MD5 Hash

md5() Method

File Validation

Size Validation

MIME Type Validation

Extension Validation

Integrated Validation Class

Practical Examples

Profile Image Upload

Batch Processing Multiple Files

Accessing Original MultipartFile

raw Property

Cautions

Cautions when using UploadedFile: 1. Validation is required before calling saveToDisk() 2. .buffer gives direct access to the pre-loaded Buffer 3. url, signedUrl are only available after saving 4. Consider streaming for large files 5. Verify Storage configuration

Next Steps

File Upload Setup

@upload decorator setup

Saving Files

Using Storage Manager

URL Generation

Generating URLs

@api Decorator

API basic usage