React: Upload File with Cloudinary

The React SDK does not include a function for uploading images to Cloudinary. We can also write own JavaScript code for direct uploading with an upload preset.

Before you start, you can read that post. Here I’ve told you how to upload images to the browser.

const API_KEY=xxXXxx
const UPLOAD_PRESENT_ID=xxXXxx

I want to upload just one file every upload, therefore i used this.state.files[0].

upload_preset is important section. You can check Setting > Upload > Upload presets for your present id. But don’t forget to check, upload present must be Unsigned.

Now you can upload your images. And also you can check this project for how to use inside the real project.