The new Cosmic dashboard is now available in private beta 🎉
Get 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


The beauty of using a static site generator is that your backend can be completely separate. In this video, I switch from markdown files to Cosmic!
Learn how I built the Twitter Search Extension to search and save Tweets to your Bucket.
This article shows you how to create a blazing fast Gatsby JS blog using Cosmic source plugin. Let’s get started.
Thanks to all who attended our first webinar / AMA last week. There was some great engagement and questions that helped steer the screen-share webinar for users in the Cosmic Community as well as first-time visitors to the system. If you missed it, check out the video and attend our next one.
This application was mainly inspired by Offerup, Letgo, and Craigslist. Like Craigslist, LetGo allows you to buy and sell items locally, which means you don’t have to deal with the hassles of shipping like you would on eBay or Amazon. With 30 million users, it is more popular than OfferUp...
With revision history, you no longer have to worry about editing mistakes. You now have the power to go back in time and revert to to prior versions.

Get started with Cosmic

Personal projects are free. Scale up as you grow.
Start building Talk to sales