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?
Rename the Postman Agent
folder in the directory C:/Users/<username>
to Postman
.
For windows:
Probably there are two ways to tackle this:
- 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
- Open the settings ( Ctrl + Comma ) and in
General\Working Directory
.
Change the default settings ofAllow reading files outside working directory
to ON like shown below:
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).
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.
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".
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
intead you can turn 'on' button of --> allow reading files outside directory this works for me
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.
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.
(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
: Usemv Postman\ Agent Postman
- Do an
ls
then check - Try uploading the image!
© 2022 - 2024 — McMap. All rights reserved.