Aks
Aks

Reputation: 1224

Not able to send the image to node.js api through postman

I am trying to use the postman for debug the api calls. For that I need to upload the video which will be upload to server using the node.js.

I am trying to send the video data to form-data as type selected file and on console I check on request body and it showing undefined. If I send the key value like some string then that string is fetched and show but not in case of video.

I am attaching the image so that it will through some lights to the error I am facing.

enter image description here

Is there anyone who suggest me why I am getting the media field as undefined and what is the solution for getting the data. Thanks in advance

Upvotes: 0

Views: 526

Answers (1)

Ebert Roos
Ebert Roos

Reputation: 36

You can use express-fileupload. This is a middleware you use with Express.js

const fileUpload = require('express-fileupload')

app.use(fileUpload({
     limits: { fileSize: 50 * 1024 * 1024 },
}));

Upvotes: 1

Related Questions