Ibraheem Khan
Ibraheem Khan

Reputation: 75

Postman error while uploading files through form-data body type

Couldn't upload file Make sure that Postman can read files inside the working directory.

Upvotes: 4

Views: 13018

Answers (2)

Edward Casanova
Edward Casanova

Reputation: 1064

  1. In your postman man web app go to settings (upper-right "gear icon") > General > Scroll down until you find working directory and verify the name (it will be useful later). Sometimes you may find a warning icon depending on your operative system. If that is the case make sure you opt-in the "Allow reading files from outside working directory"
  2. On your filesystem go to C:\Users{YOUR USER}\Postman <<< verify that this name is matches the one in settings. Sometimes by default it is set as Postman Agent (if that's the case, postman will not be able to read files from your system). Both names should match. (e.g rename Postman and Postman)
  3. Make sure your postman Agent is set to "Desktop" on the lower right part of your workspace on the postman web app

Hope it helps. I faced the same issue a couple of minutes ago.

You may also see that new folder are created everytime you upload a file to postman. Inside C:\Users{YOUR USER}\Postman\files

like {gibberish}{the file you've just uploaded} --Don't know why but it doesn't seem to have any negative effects. Perhaps it's just a bug for Windows Users

Upvotes: 20

Mostafiz Rahman
Mostafiz Rahman

Reputation: 8552

Here is what works for me in Postman file uploading:

  • Use Put request as request type
  • In request Body section, select binary type
  • Select file

You can also pass query parameters in Put request if needed.

Upvotes: 0

Related Questions