Upload file failed Postman
Asked Answered
R

9

22

I am using postman(v7.7.3) and I have got the following warning when I upload the file to send the body as a form-data. "This file isn't in your working directory. Teammates you share this request with won't be able to use this file. To make collaboration easier you can set up your working directory in Settings." How can I solve it?

Rachele answered 3/2, 2020 at 9:21 Comment(1)
In your question I think you should specify if you are using the desktop or web version of postman. I assume you are using the desktop version, but it would be good to specify. For reference the web version is web.postman.co. I believe using the web vesion and downloading the Desktop Agent is how the troublesome Postman Agent file directory comes about.Outleap
P
45

Rename the Postman Agent folder in the directory C:/Users/<username> to Postman.

Petrify answered 11/4, 2021 at 0:46 Comment(3)
Add more information to your answer. Please carefully read stackoverflow.com/help/how-to-answerDisinterested
For linux I renamed "~/Postman Agent" to "~/Postman"Secede
thanks it works!. for more detail when you use windows . The Postman "Woring directory" is set to "~/Postman/files" ~ mean your home folder ( means your C:/Users/YOURNAME) However Postman does not create a folder name "Postman" there but instead creating folder name "Postman Agent" which different from your "Woring Directory" Moreover Postman program disable you to edit "Working directory", therefore you can only rename your folder name. Then rename "Postman Agent" to "Postman" . It will be all setInconsequent
M
35

For windows:

Probably there are two ways to tackle this:

  1. Save the file in the working directory itself in the actual file location of Postman for me it was in C:\Users\xxxx\Postman\files
  2. Open the settings ( Ctrl + Comma ) and in General\Working Directory.
    Change the default settings of Allow reading files outside working directory to ON like shown below:

Settings

Manstopper answered 20/7, 2020 at 17:40 Comment(2)
it still showing This file isn't in your working directory. Teammates you share this request with won't be able to use this file. To make collaboration easier you can setup your working directory in Settings. and returning undefined in the body of the fileSago
This doesn't solve the problem in Postman v8.2Rob
B
8

This was what was in my Postman Settings. But in my Desktop, the folder was names as Postman Agent, so the path was ~/Postman Agent/files. Therefore Postman couldn't read from my system, rename Postman Agent in your local machine to Postman.

This is more like a bug with Postman (already open issue, still not corrected).

enter image description here

Biel answered 1/8, 2021 at 20:58 Comment(1)
This answer needs to be worded a little better. But is absolutely the solution. Thanks !Sorrows
M
4

For the sake of guys who are using the web version of Postman on windows 10. Actually, when you are uploading files those files should be in the "working directory" of Postman. No worries, because otherwise, the postman copies the file you want to upload to the working directory.

How to find that working directory? Do as I say.

In windows, go to

"C:\Users<your windows account's username>".

In that folder just scroll down and you will see a folder named "Postman Agent". It is the working directory (technically it is the directory which holds the working directory but it is not important right now, I've explained it later). Now, it should be renamed as "Postman". Afterwards, go to the postman and try to upload the file you want, and it should work now.

If you want to know why it happens just read the below explanation.

If you press "Ctrl + ," (control button with comma button) when you are in the postman tab on the browser, it will open the settings. In settings, just scroll down and you will see something like this.

enter image description here

On the left side, you can see a text bar under the "Location" label. Actually, that "~/Postman/files" in the text bar is the working directory of Postman. Because of some reason (a reason that I don't know), on windows, the working directory is "~/Postman Agent/files". That's why we have to change it to the correct name that Postman requests. The correct name is "Postman", not "Postman Agent".

Manns answered 18/8, 2022 at 8:13 Comment(0)
T
1

i have found the solution. Go to settings and here we see working directory is by default Postman/files. now first of all go to this directory in computer and paste all images here. after this go to postman and select the file from this directory. then there will be no problem in uploading images

Thornie answered 4/7, 2022 at 6:42 Comment(0)
M
1

intead you can turn 'on' button of --> allow reading files outside directory this works for me

Medication answered 9/5, 2023 at 7:0 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Lorrianelorrie
P
0

As answered by Rishma Bibi, in my version of postman desktop (Version 9.27.2), if you go to Postman>Preferences>General, look for Working Directory settings to enable based on your use case. You can find more details in this documentation.

Predisposition answered 16/8, 2022 at 14:35 Comment(0)
U
0

go to setting in your postman then make this steps:

on Request tap change this

  • Trim keys and values in request body (on)
  • SSL certificate verification (off)
  • Always open sidebar item in new tab (on)
  • Language detection (change to json)
  • Request timeout in ms (change to 0)
  • Max response size in MB (leave it as default)

Then go to Location and change location to ~/postman/files (adding folder named "files" if not exists) then move your files need to upload to this folder above.

hope this helpful.

Unkennel answered 8/9, 2022 at 3:14 Comment(0)
T
0

(Mac OS) For web users -

  • Go to your home folder in the terminal, try ls
  • If you can see the Postman Agent: follow the next steps
  • Rename Postman Agent -> Postman: Use mv Postman\ Agent Postman
  • Do an ls then check
  • Try uploading the image!
Topaz answered 3/4 at 3:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.