Wowza Community

Struggling to upload assets to Wowza Video using Node.js

Hello,
I have followed the steps which are given on wowza documentation for upload assets through API and I am able to upload a video using curl command in step#2 (Upload Assets). However, I need to do step#2 (Upload Assets) through nodejs in my project. I am running all the steps using Axios. I will explain the steps below, and I would like you to guide me in curl cmd (step#2) have implemented it through nodejs. I might be doing wrong, as the Wowza video UI shows ‘processing,’ and after a while, an error appears. I think in this 2nd step I have done something wrong so please guide me on how I can implement step#2 through nodejs.

const fileData = new FormData();
fileData.append(‘file’, selectedVideo);

Step 2: Upload the asset - the actual upload_url I obtained in step 1.
const uploadVideo = await axios.put(
wowzaResponse?.data?.asset?.upload_url,
fileData,
{
headers: {
‘Content-Type’: ‘video/mp4’,
Authorization: Bearer ${WOWZA_TOKEN},
},
}
);