You can only upload files up to 4MB on the server. If you want to upload files larger than 4MB,
you can use the client side SDK to upload files directly from the browser.
Prerequisites
To follow this guide, you will need to:Install and initialize Restash
1
Install
Install Restash Node using your preferred package manager.
2
Initialize Restash
Initialize Restash with your private API key.
lib/restash.ts
3
Use Restash anywhere in your server code
You can now import Restash and use it to upload files.
Uploading your first file on the server
In this example, we will upload a file inside a Next.js API route.api/upload/route.ts