Unable to upload video file after stagedUploadCreate

Unable to upload video file after stagedUploadCreate

nik232
Shopify Partner
2 0 1

Got this error: Content-length smaller than lower bound on range, while clling POST api after stagedUpload for video file. 

nik232_0-1697691404233.png

 

- i am making post call using axios from node js to upload video file using policy, signature,key and googleAccessId.

- please let me know that do i need to pass blob or base64or utf8 data.

 

    const bodyData = new FormData()
    stagedVideoData.parameters.forEach(element => {
        bodyData.append(element.name, element.value)
    });
    bodyData.append("file", JSON.stringify(video))

    // POST call for file upload
    await axios.post(stagedVideoData.url, bodyData)
    .then(data => {uploadVideo = data
        console.log(data, "data inside then");
    })
    .catch(error => {
        console.log("=======", Object.keys(error),error['response']['data'], "=========");
    })
 

- here i am passing multer parsed file into form data as file.

please provide your suggestions.

Thanks
Nikunj

Replies 0 (0)