Avdhesh
Avdhesh

Reputation: 51

File upload using postman

Could you please tell me how to upload file without USING File option. I would like to know how I can upload file by following below approach.

  1. From Body - Form data - Type as Text approach
  2. How I can upload file using Body - raw - Json file type

I do not want to use File > Choose File option. I would like to execute through newman and using File > Choose file option it is failing.

I tried to use below approach but it is giving 404 as response.

Body - Raw-->
{
"uploadType": "ORDER",
"headerIncluded":"false",
"file":"C:/Users/b3badm/Desktop/SIndoora/FileImport_ValidProducts.txt"
}

Upvotes: 5

Views: 16600

Answers (2)

Jim
Jim

Reputation: 136

img

This option is hidden by default! Only move your cursor over the area will appear the Text for you to change to File! You should also put file or something in the key column.

Upvotes: 5

n-verbitsky
n-verbitsky

Reputation: 552

From the Postman GUI the only way to send a file is to add it as a form-data via File -> Select Files or Binary -> Select files.

If you want to execute such request via Newman you need to manually edit your collection.json file to add the full path to the file you're trying to send on your local machine in request.body.formdata.src parameter.

More details can be found in Postman Blog.

Upvotes: 0

Related Questions