How to upload media files to strapi backend endpoint

In this blog, we are going to discuss how can we send the images along with the data to strapi backend server endpoint from reactjs or any language. Before getting into the main content, should know what Stapi is and how it is simplifying the backend for you.

If you are a person like me who does not know anything and is bothered about creating and running the server but trying to make one by yourself then strapi is the right choice for you.

Stapi is a headless cms backend, where you can create, run and configure the server with hardly writing a single line of code.

After started using strapi, there was a time where I failed to upload images along with data to my strapi backend server from reactjs. And I could not able to find proper documentation for uploading data/media to the endpoint, after all going through so many days then I realized where I am doing wrong in posting the data to strapi endpoint and we gonna discuss how to achieve that through this blog.

So I believe you know how to create the schema for content through content-type builder in strapi.

If not I highly recommend checking their documentation first on how to get started with strapi. Here is the link for it https://docs.strapi.io/dev-docs/intro

The below code is in reactjs framework