Module – API – Upload
This module provides easy and secure file uploading functionality to your Node.js application, designed for handling various file types and sizes with scalability in mind.
by Gruntsass
Price History +
The Upload module offers a reliable and customizable way to manage file uploads within your Node.js application. Below are the main features of the module:
- File Uploading: Allows secure file uploads through HTTP POST requests, including validation for file type and size. Supports uploading multiple formats, ideal for profile pictures, documents, and other files.
- Image Processing: Includes support for image processing using Sharp, with options to resize, reformat, and apply quality settings to images. This feature ensures images meet predefined standards, reducing server load and improving user experience.
- Watermark Support: Optionally applies a watermark to uploaded images, allowing you to brand or secure image assets before saving them.
- Storage Configuration: Configurable storage options via environment variables, including local storage and cloud-based services (such as Amazon S3). Environment variables such as UPLOAD_STORAGE_PATH and UPLOAD_MAX_FILE_SIZE make it easy to manage where files are stored and their size limitations.
- Error Handling: Includes comprehensive error handling with informative logging and HTTP status responses, ensuring robust communication with clients if a file fails validation or cannot be saved.