The new Cosmic dashboard is here!
Test drive it now →

Upload Media to Your Cosmic Bucket Using Multer

Community Articles
Community Articles Upload Media to Your Cosmic Bucket Using Multer

This is a quick, fully-working example of how to process an uploaded image server-side using Multer.

Open a terminal and run the following commands:

mkdir test
cd test
npm i cosmicjs multer express
vim index.js
// Add the gist code below to index.js
node index.js

Then if you're using Postman. Set this request up to test:

POST http://localhost:5000/upload

Add form-data file to the request.

Let me know if you have any questions! DM me in Slack, or reach out on Twitter.

Photo by Daniel Leone on Unsplash.



You may also like


With so many choices for which technology to use when building a website, it can get overwhelming.
Learn how I built the Twitter Search Extension to search and save Tweets to your Bucket.
Looking to migrate from Contentful to Cosmic? The Contentful Importer makes it quick and easy.
To demonstrate how easy it is to get started with Cosmic, we'll utilize the Cosmic CLI to quickstart a React Auth App. This app shows implementation of Authentication in ReactJS, NextJS and NodeJS using the Cosmic API. This app has all the basic modules like signin, signup, view/edit profi
An easy way to add analytics dashboard in your cosmic bucket.
Use Cosmic as a seamless content management system for displaying large amounts of educational data

Get Started with Cosmic

Build personal projects for free. Add your team at unbeatable prices.
Start Building Talk to Sales