Server uploads
Learn how to upload files from your server to Restash.
Easily upload files from a Node.js server to Restash. This guide shows you how to set up server-side uploads using our lightweight SDK.
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
Install
Install Restash Node using your preferred package manager.
Initialize Restash
Initialize Restash with your private API key.
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.
Next steps
Check out the full Node.js SDK for more information on how to use the SDK.