File Upload (Cloudinary)
The File Upload component provides a standardized way to handle file uploads in Servercn using Cloudinary as the storage provider.
Docs:
Installation Guide
This component requires additional Servercn components.
npx servercn-cli add file-uploadYou will be prompted to select a file upload provider:
The CLI will then automatically configure the component based on your selected provider.
Prerequisites
You must have a Cloudinary account. Click here if you don't have one.
Define the following environment variables:
Ensure the following configuration is defined:
Basic Implementation
1. Cloudinary Configuration
Create a Cloudinary configuration file:
2. Upload Middleware
Servercn uses multer to handle multipart file uploads.
3. Cloudinary Services
Services for uploading files to Cloudinary and deleting files from Cloudinary.