Upload Media to Your Cosmic Bucket Using Multer
Note: This article has been archived as it may contain features or techniques not supported with the latest version of Cosmic.
Back to blog
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:
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 might also like
New dashboard private beta and API v3 release
We are excited to announce the release of the new dashboard in private beta along with the API v3. T...
January 31, 2023
New dashboard updates: Metafields, localization, and more
We've released some new features for the new dashboard that we are excited to share with you.
September 13, 2022