Skip to content

AhmadTheTech/file-upload-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Upload API

This is a ready-to-use file upload backend for your components. It enables you to upload files directly to Cloudinary via Vercel, providing a seamless integration for your projects.

What You Get

This API provides secure file uploads directly to Cloudinary, works seamlessly with any file upload component, and follows a deploy-once-use-everywhere approach. You won't need any server maintenance once it's deployed, making it a hassle-free solution for all your file upload needs.

What You Need

To get started, you'll need a free Cloudinary account for file storage and a free Vercel account for hosting the API. Both services offer generous free tiers that are perfect for most projects.

Quick Setup

Getting Your Cloudinary Details: First, sign into your Cloudinary Dashboard and locate three important pieces of information: your Cloud Name, API Key, and API Secret. You'll find these on your dashboard's main page.

Deploying to Vercel: The easiest way to deploy is using the one-click deploy button below. Simply click it, and it will guide you through connecting your GitHub account if needed, then prompt you to add your Cloudinary credentials as environment variables.

Deploy with Vercel

Getting Your API URL: Once the deployment is complete, Vercel will provide you with a unique URL that looks something like https://your-project.vercel.app/api/upload. Save this URL as you'll need it for configuring your components.

Using in Your Projects

Integration is straightforward. Simply add your API URL to your file upload component configuration. The API is designed to work with standard form uploads, so your files will be processed and stored directly in your Cloudinary account without any additional configuration needed on your end.

API Details

The API endpoint accepts POST requests at /api/upload and can handle any file type via standard form upload. When a file is successfully uploaded, the API returns detailed information including the Cloudinary file URL and metadata, which you can use in your projects.

Features

This API supports multiple file types including images, videos, and documents. It includes automatic security validation to ensure safe uploads, leverages Cloudinary's global CDN for fast delivery worldwide, and provides real-time upload status updates. Importantly, no files are stored on the API servers themselves - everything goes directly to your Cloudinary account.

Security

Security is built into every aspect of this API. Your environment variables are protected and never exposed, file types are automatically validated to prevent malicious uploads, size limits are enforced to prevent abuse, and the direct-to-Cloudinary upload approach means no sensitive data is stored on the API servers.

Support

If you encounter any issues, there are several troubleshooting steps you can take. Check your Vercel deployment logs for any error messages, verify that your Cloudinary credentials are correctly set in the environment variables, and test the API endpoint directly to ensure it's responding properly.


Deploy once. Use in all your projects.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published