Make sure that postman can read files inside the working directory
Make sure that postman can read files inside the working directory
This file resides outside the working directory. Collaborators might not have the same file path. #6556
Comments
xiandadaa commented May 21, 2019 •
After being updated to 7.x, you cannot upload files like an array。Unable to read files outside of working directory
The text was updated successfully, but these errors were encountered:
saswatds commented May 21, 2019
Hi @xianda666
Prior to v7.1.0 postman did not sync file paths across the different apps. The current behavior is as follows
If a file is selected inside of the working directory we save the relative path to file
If a file is selected outside of the working directory we save the absolute path to the file.
By default, postman does not trust absolute paths. You can already see that the app is already warning you of that. This is a security feature added so that when untrusted collection/request is executed on your system, they don’t steal your data.
If you are sending the request from a computer which is different from the one where you selected the file, the app by default doesn’t trust the file and throws the PPERM error.
You have 2 ways to go about from here
Hope this clarifies the messaging. We will try and improve messaging in future iterations. For knowing more into the background of this change, you can check out #4320 (comment)
upload file in collection runner #3137
Comments
zhangmoon commented Jun 8, 2017
hi, does postman support upload file in collection runner.
I run upload file in collection runner, the file does not upload.
The text was updated successfully, but these errors were encountered:
kamalaknn commented Jun 8, 2017
At the moment Collection Runner does not support uploading files. That is because saved requests can be shared with others in the team, or be synced to an app on a different machine, and the file path would be invalid for then.
Could you explain your use case so we see if there are any other ways to achieve this?
bigbigmike commented Jun 8, 2017
I also had this dilemma and ended up installing Newman to run my collection with a file upload and I was successful. It would be a good feature to be able to provide a way to do this in collection runner.
nagabhiru commented Aug 4, 2017
Our web application requires us to upload a zip file and then run a job through REST APIs.
I have created a collection that does this but I can run it only through Newman.
I understand that collections can be shared and the file path would be different across machines.
Currently Collection Runner has option to select data file (json/text/csv)
If you can enable option to manually select any file to be uploaded in the Collection Runner that would be great.
Teams will then select the appropriate file from their machines in the Collection Runner GUI before running.
One workaround is that currently Postman searches for the file to be uploaded in:
«C\Users’username’\appdata\Local\Postman\app-x.x.x»
If you copy the file to that location you can successfully upload it from Collection Runner
kamalaknn commented Aug 7, 2017
@shamasis @numaanashraf what are your thoughts on this?
amerryma commented Sep 1, 2017
Yes I would like to see if we could do this as well. Assuming each team member has the file in the same spot it should work.
dipakbachhav commented Sep 8, 2017
I am using postman collection runner to upload images. I have already created environment and able to use collection runner for other api but while uploading image I am failed. Is postman collection runner supports image upload operation and can i run multiple iteration for image upload?Can you please help me?
abhijitkane commented Sep 12, 2017
tazmaniax commented Nov 18, 2017 •
+1 to add support for uploading files specified as file paths in the runner data
santakd commented Apr 2, 2018
+1 to add support for uploading files specified as file paths in the runner data. This will really help.
AlbertORoura commented May 2, 2018
+1 same here! That will awesome 🙂
funkydunc commented May 7, 2018
I would like to be able to store a different relative file path per request:
I’m using Postman / Newman to test a CSV Import API. Each tests uses a different file which tests a different error case.
I can export the collection to json, and add the ‘src’ attribute in a test editor and this works in Newman as documented here:
But, if I reopen the collection in postman to write more tests, it removes the ‘src’ attributes.
It would be great to have this fixed. Thanks!
sebcaps commented Jun 19, 2018
In addition this workaround can hardly be set up in a continuous integration environment.
It would be a great thing to handle this.
My 2 cent’s :
grafikri commented Oct 8, 2018
bizzard4 commented Oct 18, 2018
mlb5000 commented Jan 7, 2019 •
The main client should at least retain the modified file src value, and only overwrite it when/if that actual request is modified (if then). I get not being able to refer to a specific file in the Postman collection runner since it’s literally an embedded Chrome browser and browsers (rightly) don’t let you do that sort of thing, but the workflow between building in Postman and running in newman is completely disrupted by losing file src paths during the import/export process.
And I’m definitely not about to develop my test collections directly in JSON.
JordanStopford commented Feb 8, 2019
xargsyan commented Feb 11, 2019 •
+1 to implement it.
This is confusing, since tests («Run Collection») fail on file uploads.
And is really important bug, since it makes the whole «Collection Runner» feature unusable if there is a file upload.
@abhijitkane, @madebysid the issue is «closed» yet has the «feature» tag.
Does it mean that the issue is «closed» and won’t be done? or will be done in the next versions?
We are (all) looking forward for your (positive) response. Thanks.
jscul commented Feb 26, 2019 •
I don’t often comment on threads like this but this feature is a must have for API testing. if every time we download Postman and sync our data we have to re-upload all of our images collaboration becomes a nightmare and makes Postman unusable for multipart/form testing.
danabeled commented Mar 25, 2019 •
This is my first comment on github ever, this feature is a no-brainer add in my opinion. It’s the single thing making my team doubt if it’s viable for our CI test process.
sahanakrishnaiyer commented Mar 28, 2019
+1 to have this feature implemented
andreacab commented Apr 16, 2019
+1 here too, we would like to use postman as our api testing tool, but this is currently stopping us.
Unable to send files in postman post request #6534
Comments
ghost commented May 17, 2019
When I select the image in postman form-data it is given warning as This file resides outside the working directory and no file is sent in the request
The text was updated successfully, but these errors were encountered:
saswatds commented May 17, 2019 •
Hi @yajan
Recently we have updated how file references work with postman. Can you give us more details according to our issues guidelines?
If you are on v7.1.0 of our app, you can check these to comments to understand how it works
BCsRock commented May 17, 2019
We found an issue related with the new update.
When selecting files outside of working directory somehow Postman messes up the command to send the files. This happens only from today, not the days before.
Sometimes, postman generates the correct file references and sometimes it is adding too many slashes. And it really seems random.
I try to explain below.
Files outside of Working Directy
When clicking on Code with multiple files
Note the number of slashes after publicFiles=@ is always different.
As a result, only the file Readme.adoc was sent correctly. the other files have been skipped,
Note the number of / after publicFiles=@ are only one. The sending works correctly.
When using files *inside * working directory the reference uses only an @ and is always correct
Post method does not maintain uploaded file if changing any other parameter of API #6516
Comments
mubashir3gca commented May 15, 2019 •
Describe the bug
I am using post request in postman. I am providing a text file as file input parameter in api parameter and there are other parameters as well but those are simple text input parameters.
In case, I am providing all parameters and sends the request and if api request gets failed due to input field validations of text input parameters. In such situation, when updating/modifying the invalid/faulty text input parameter value to valid value, then postman shows the name of file (that was previously provided as file input) along with its extension but when re-submits the same request then it gives error message related to file input parameter that the required file is missing.
I have observed that if on first attempt, if API request is failed due to any other invalid input parameter then on modifying that invalid parameter value, I must have to provide the file input every time even if it is showing the same file name in the file input field. This issue has been observed in the latest version of postman. In earlier version of postman, it was maintaining the provided input file.
To Reproduce
Steps to reproduce the behavior:
Go to New and create a new request with post method
Go to Body tab and select form-data
Add few parameters as text input along with their values in key value columns (provide any one parameter with invalid input value in order to make the API request failed due to data validation or leave any required parameter as empty)
Add one parameter as file input and provide a valid file for it (this is required)
Submit the request and API request should be failed due to missing required parameter or due to invalid value in any of the provided parameter
Now provide the missing value for required parameter or modify the invalid value of the parameter
Postman will be showing file name with its extension as provided earlier
Now re-submit the same request and this time API will fail again and it is due to file input parameter since it is missing
Screenshots are provided for reference
Expected behavior
It should maintain that provided file (as it was in previous version of postman).
Screenshots
See the attached screenshots for reference.
App information (please complete the following information):
The text was updated successfully, but these errors were encountered:
saswatds commented May 16, 2019 •
Hi @mubashir3gca,
Recently we have made some changes to ensure that we can persist file references along with collection. I have given a more detailed explanation of the behaviour in this issue #4320 (comment)
Having said that, I need some more information from you regarding this issue.
mubashir3gca commented May 16, 2019
saswatds commented May 16, 2019 •
Hi @mubashir3gca, Thanks for the input.
Prior to v7.1.0 postman did not sync file paths across different app. The current behaviour is as follows
By default postman does not trust absolute paths. You can already see that the app is already warning you of that. This is a security feature added so that when untrusted collection/request are executed on your system, they don’t steal you data.
As you have stated that you are sending the request from a computer which is different from the one where you selected the file, the app by default doesn’t trust the file and throws the PPERM error.
You have 2 ways to go about from here
I think this should fix the problem. Feel free to respond back if this doesn’t work.
rubenmelcon commented May 16, 2019
I had the same issue and I tested your second solution but it doesn’t seems to work. In my case, I’m executing a multipart upload with two files, but the tool only sends the last updated parameter.
If I update the var1, Postman will send the file «file.json» but not var2. If, in this point, I update the var2 parameter, then I will receive the file «file-schema.xml» but not the var1 parameter.
Hope that this information helps you in detecting the origin of the problem.
saswatds commented May 16, 2019
Hi @rubenmelcon, this is not supposed to happen.
The internal tests I have setup is able to send both the file properties. This is the step by step detail of how I have done to replicate it and would request you to attempt it as well so that we are on the same page.
4. Selected the second file and sent a request (As seen below)
As you can see both the file we sent and the server responded with both the filenames.
Can you confirm that you do not experience the same behaviour?
rubenmelcon commented May 16, 2019 •
I just tested with the same URL that you used:
In my first case, I copied my original request and updated the datasource parameter to clean some information and the response was:
As you can see I don’t have any of the files.
After that, I updated the var1 variable, and the response was:
As you can see, only the file «file1.json» was sent.
Now, changing the var2 parameter and resubmitting the request I can see how the file from the var1 parameter is not in the response but I have the var2 file:
Just to confirm that it’s not related with my (original) request, I created a new one with only one parameter:
That’s perfect, but if I add another parameter (it doesn’t have to be a file) I will loose the information related with the file:
Thank you very much
saswatds commented May 16, 2019
@rubenmelcon Thanks for the input. We are really sorry this is happening. I will try to find the root cause of this problem in high priority and keep this thread updated with my findings
saswatds commented May 16, 2019
rubenmelcon commented May 16, 2019 •
I’m not at the office, but I can replicate the same problem from another computer. And «yes», from my (new) current installation when I try to replicate this issue I can see the error message in the console. Sorry to not give you before this information. Let me put here all the steps and information.
The first request has only the parameter with the file:
As you can see, everything is ok and the console doesn’t show any error:
Now, I will include a normal (text) parameter «var2»:
We can’t see the «var» parameter and looking at the console we have the message that it’s not able to find the file:
Maybe the problem is all the chars before «C» in the route «/////////C:/Users/ruben/Desktop/file1.txt». I’m not sure it this was also the previous error message because I was using another computer, but I think that it’s very probable. If you want, I can confirm this on next monday.
Also, the console shows that the requests has only the var2 parameter:
Thank you very much
saswatds commented May 16, 2019 •
Thanks a lot @rubenmelcon 🎉
I have been able to reproduce the issue internally. You are right the issue is with the extra / being added in front of every absolute path in windows os. The request shows only one file because of the runtime not being able to load the file.
We have already applied the patch with additional tests for windows to our builds, and it should be out within a few days.
mubashir3gca commented May 17, 2019 •
Hi @mubashir3gca, Thanks for the input.
Prior to v7.1.0 postman did not sync file paths across different app. The current behaviour is as follows
By default postman does not trust absolute paths. You can already see that the app is already warning you of that. This is a security feature added so that when untrusted collection/request are executed on your system, they don’t steal you data.
As you have stated that you are sending the request from a computer which is different from the one where you selected the file, the app by default doesn’t trust the file and throws the PPERM error.
You have 2 ways to go about from here
I think this should fix the problem. Feel free to respond back if this doesn’t work.
I have tried the first method suggested by you. I have placed the specific file in the working-directory path and it worked fine for me.
I have also tried the second method suggested by you. I have turned on the setting «Allow reading files outside working directory» and then I submitted request. It is giving error in console in case I have updated any other API parameter value.
There are multiple ‘ \ ‘ at the start of the path which may be causing issue for file to be loaded.
I have provided the screenshots for reference.
Working directory setting is ignored #9510
Comments
guillep2k commented Jan 31, 2021
Describe the Issue
Even when I store my files in the folder set as «working directory» and I attempt to use them as source data for a request, they show up with the warning «This file isn’t in your working directory».
Steps to Reproduce
With default settings:
With custom settings:
Note: Turning ON and OFF the «Allow reading files outside working directory» has no effect.
Screenshots or Videos
Environment Information
The text was updated successfully, but these errors were encountered: