v1.3.3
Add buffer upload plugin with ArrayBuffer support
Summary
Implemented new Buffer Upload Plugin that processes file uploads in memory and passes data as ArrayBuffer to JavaScript callbacks, along with necessary framework updates.
Changes
-
Rust Plugin :
- Created new plugin to handle file uploads in memory (100MB limit)
- Stores file contents directly into request body as binary data
- Adds upload metadata (filename, size, content-type) to request headers
-
TypeScript Definitions (
HttpServer.nitro.ts):- Added
BufferUploadMountinterface withtype: 'buffer_upload' - Updated
Mountableunion type to include new plugin - Enhanced
HttpRequestinterface withbinaryBody?: ArrayBufferfield
- Added
-
C++ Bridge Fix (
HybridHttpServer.cpp):- Fixed binary data handling for Nitro modules
- Added proper detection for buffer upload requests via headers
-
Documentation (
README.md,README_zh.md):- Added plugin to features list
- Included configuration examples
- Updated type definitions and FAQ section
- Explained differences between disk-based and memory-based uploads
Key Features
✅ In-memory file upload processing (up to 100MB)
✅ Direct ArrayBuffer access in JavaScript callbacks
✅ Seamless integration with existing mount-based architecture
✅ Comprehensive type safety with TypeScript definitions
✅ Fixed C++ compilation issues for binary data handling
The buffer upload plugin provides efficient in-memory processing for smaller files while maintaining compatibility with the existing upload infrastructure.