Kindly wait a moment, post will be visible in just 5 seconds.
Rizwan Khan
Posted on 15 May 2021
In this guide you are going to learn about image uploading using nodejs, express and cloudinary.
Do not worry about cloudinary, Its a platform to create the most engaging visual experiences.
Developers and marketers use Cloudinary to quickly and easily create, manage and deliver their digital experiences across any browser, device and bandwidth.
Image and Video API for Powerful Visual Experiences
Store, transform, optimize, and deliver all your media assets with easy-to-use APIs, widgets, or user interface.
Robust Transformations Done Easily
Manipulate images with a URL-based API
Create Cutting-edge Video Experiences
Powerful video editing and management at your fingertips
Make Websites and Apps Load Fast
Automatically optimize rich media and deliver via multi-CDN
Free Storage upto 1 GB
Enough Talk, lets continue the implementation
Initialize the Project by using below command in your terminal
Now Install required libraries to create server
Server code index.js
Now Install nodemon to run the development server with watcher
Now open your package.json file and write in your script tag
Now its time to run application
Now trigger your api using POSTMAN with url localhost:3000/upload
Response will be { message: 'Hello User'}
Now its time to create an account in cloudinary.com
After creating account; go to your dashboard; there you are going to see account details
Now install another library for cloudinary and formidable for file handling request
Now lets update our index.js file code
Important things to note files.image.path
files is the file object which we are sending in form data such as
image is input field name
path is temporary image location
Now if you are using POSTMAN simply open it
thats all
If you have any trouble plz let me know in the comment section...
Thanks for coming till here
India
Coding is an art and I love art
Learn trending tech & full-stack development. Book now
0 Comments