You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I’m experiencing an issue when trying to create a document in the tests collection via REST API using multipart/form-data to upload an image along with text fields (firstName, lastName, user). The request works fine when using JSON with just the media ID, but fails with the error Cannot read properties of undefined (reading 'firstName') when I send a file directly.
Steps to Reproduce:
Set up a tests collection with the following configuration:
*** I have this collection and I want to make a post request with the api/test path.
I did the test in my postman:
1- Body: If I send the data in the body format, i.e. as follows, the request is done correctly (in this method, the file is uploaded first and its ID is placed in the request)
{
"lastName": "test new",
"firstName": "me",
"image": "67bed87ed05f4b76c53e2bde"
}
2- form-data: If I want to send the request in the multiform method, i.e. send the file, the server side returns an error:
Req:
err:
Cannot read properties of undefined (reading 'firstName')
Does the payload have a method for what I want (sending a file to the desired collection) or not?
The text was updated successfully, but these errors were encountered:
Description:
I’m experiencing an issue when trying to create a document in the
tests
collection via REST API usingmultipart/form-data
to upload an image along with text fields (firstName
,lastName
,user
). The request works fine when using JSON with just the media ID, but fails with the errorCannot read properties of undefined (reading 'firstName')
when I send a file directly.Steps to Reproduce:
tests
collection with the following configuration:*** I have this collection and I want to make a post request with the api/test path.
I did the test in my postman:
1- Body: If I send the data in the body format, i.e. as follows, the request is done correctly (in this method, the file is uploaded first and its ID is placed in the request)
{
"lastName": "test new",
"firstName": "me",
"image": "67bed87ed05f4b76c53e2bde"
}
2- form-data: If I want to send the request in the multiform method, i.e. send the file, the server side returns an error:
Req:

err:
Cannot read properties of undefined (reading 'firstName')
Does the payload have a method for what I want (sending a file to the desired collection) or not?
The text was updated successfully, but these errors were encountered: