Using Expo camera recording video upload server using axios api request showing error

Viewed 168

Using Expo camera recording video upload server using Axios API request showing error give me any solution to upload video I have followed this link to upload video http://5.9.10.113/67057902/uploading-video-recorded-with-expo-camera-to-server

Here is my code :

const videoMergeAction = async () => {
  
try {

// commit("LOADING",true);
setisLoading(true)

let data = new FormData();

data.append("first_video_file",{
  name:"firstVideo.mp4",
  uri:firstVideo,
  type:videoType1,
});
data.append("second_video_file", {
  
  name:"secondVideo.mp4",
  uri:secondVideo,
  type:videoType2,
});
data.append("third_video_file", {
  
  name:"thirdVideo.mp4",
  uri:thirdVideo,
  type:videoType3,
});


let config = {
    header: {
      "Content-Type": `multipart/form-data`,
    },
   
  }


console.log('77',data);
const response  = await Api.post("/upload-video", data, config)
console.log('65',response.data);
if(response.status == 200) {
    console.log('87',response.data);
    setresVideoData(response.data.video_url)
    setVideoPath(response.data.video_path)
    // commit("LOADING",false);
    setisLoading(false)
    navigation.push('VideoPreview')
}


} catch (error) {
    console.log('video submit fail',error)
    setisLoading(false)
}

}

enter image description here

0 Answers
Related