Upload Media to Your Cosmic JS Bucket Using Multer

Community Articles
Community Articles Upload Media to Your Cosmic JS 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.



Was this article helpful?

Thank you! Your input helps us improve our articles and resources. If you have any other questions or comments, please contact support.

You may also like


Next.js is a React framework for building hybrid applications. It's flexible, extensible, and works great with any data provider. In this tutorial, we'll show how to get started with Cosmic CMS and Next.js.
Using Cosmic JS's Webhooks we can sync Algolia with Cosmic JS to provide search to our projects.
Use Cosmic JS as a seamless content management system for displaying large amounts of educational data
Todo List app built using Svelte that utilizes the power of Cosmic JS.
Cosmic JS has powerful content modeling and delivery tools to help you build apps faster, together. Cosmic JS lets you manage all your content, data and files and is unopionated as to the format of content you're uploading. The Cosmic Editor allows you to upload rich media such as video, images and
An easy way to add analytics dashboard in your cosmic bucket.

Ready to Get Started?

No payment info required.
Start Now Contact Sales