I am trying to create a request in the pre-request script using in the form-data and in the body i would like to upload a pdf file from my working directory.
I used the following script and i dont know why it not uploading the file.
Can you please help ?
"body":{
"mode": "formdata",
"formdata": [
{ "key" : "file","value": "X:\\Postman\\files\\test.pdf", "disabled" : false, "description" : {"content" :"", "type" :"file"}},
{ "key" : "text","value": "text", "disabled" : false, "description" : {"content" :"", "type" :"text"}},
{ "key" : "Number","value": "12345686", "disabled" : false, "description" : {"content" :"", "type" :"text"}},
{ "key" : "Text","value": "0011002327", "disabled" : false, "description" : {"content" :"", "type" :"text"}},
{ "key" : "Date","value": "02/12/2020", "disabled" : false, "description" : {"content" :"", "type" :"text"}}
]}
Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.