cover-img

How to Upload Audio and Video to Cloudinary in Nodejs

9 November, 2021

7

7

3

Even after reading the documentation, I ran across a few problems when uploading audio and video to cloudinary. Although I read some publications online, such as StackOverflow, the methodology differs and appears to be a little complex. Still, after discovering a technique to upload audio and video smoothly, I decided to share the steps with anyone who might find the blogs and articles challenging to use.

Prerequisite

A working knowledge of JavaScript

A basic understanding of NodeJS

What is Cloudinary?

Cloudinary is an end-to-end image and video management system for websites and mobile apps that handle everything from image and video uploads through storage, manipulations, and optimizations, all the way to delivery.
Without installing any extra software, you can effortlessly upload photographs, audio and videos to the cloud and automate clever transformations of those material using Cloudinary. Cloudinary seamlessly provides your media via a fast content delivery network (CDN) designed according to industry best practices.

Why do you need to upload to the cloud?

In a nutshell, uploading media to the cloud extends the life of an application. It provides a lot of value right out of the box, allowing you to focus on solving complex business logic.

Create a New Project

To open visual studio code, navigate to any Directory of your choice on your pc. In the terminal, type:

Note: code . won't work if you don't have visual studio code installed on your system

Create a directory and initialize npm by typing the following command:
Create the necessary files as shown below
img
We'll install several dependencies like multer, express dotenv cloudinary and development dependency like nodemon to restart the server as we make changes automatically.
Now let's create our NodeJS Server adding the following snippet to our app.js index.js .env,.
In our app.js.
In our index.js.
If you notice, our file has some environment variables. You can create a new .env file if you haven't and add your variable before starting our application.
In our .env.
To start our server, kindly edit the scripts object in our package.json to look like the one shown below and then type the command to start the server safely.

type the command npm run dev.

Audio Upload

Before we get started with the upload, kindly make sure you have created a Free Cloudinary Account. Then, copy the API KEY, CLOUD NAME, and SECRET on your dashboard because we will be using them shortly.
Add the snippet below to our file app.js for audio upload.
Now Let's test. 👇👇👇
img

Video Upload

Let's try out the video upload by adding the snippet below:
Result 👇👇👇
img
We can see how seamless it is to upload audio and video to Cloudinary from our nodeJS application.
Here is a link to the Repository on GitHub

Conclusion

We learned about Cloudinary and how to upload both audio and video to Cloudinary from our NodeJS application.
Happy coding!

Resources

I'd love to connect with you at Twitter | LinkedIn | GitHub
See you in my next blog article. Take care!!!

node

web development

cloudinary

7

7

3

node

web development

cloudinary

Idris Olubisi
Software Engineer | Technical Writer | Content Creator | Speaker

More Articles

Showwcase is a professional tech network with over 0 users from over 150 countries. We assist tech professionals in showcasing their unique skills through dedicated profiles and connect them with top global companies for career opportunities.

© Copyright 2025. Showcase Creators Inc. All rights reserved.