Open josslamberti opened 7 years ago
@josslamberti Thanks for the suggestion! We'll take a look at this.
may i know the status of this issue? we are in a situation to use this :)
No ETA just yet. We have some work on variable types on our roadmap, so we'll consider this request then.
Would love to see this feature, would save me like an hour of manually dredging through tons of file setting options.
We would love that too !
Also when importing a collection (because we use newman), the path we could set manually in json is removed...
It would be great o see this added. Its been 2 years since the suggestion. Hopefully, it will be added at some point....
It is actually possible. just export the collection to .json and replace the file path by a placeholder like this.
"formdata": [{
"key": "filename",
"contentType": "image/jpeg",
"type": "file",
"src": "{{filePath}}"
}],
Re import the collection.json back in postman.make sure your files to upload are in your local postman working_directory.
Hi, @schmitzdenis : Thanks, for the hint. This works only once. But, we wanted to exchange the src-file during runtime, e.g. for iteration.
Not sure to understand the issue then @Chekkov , the filePath will change with any value it's assigned to. So for every iteration of a postman runner, or when you change it with pre-request script at runtime as an example ..
It is actually possible. just export the collection to .json and replace the file path by a placeholder like this.
"formdata": [{ "key": "filename", "contentType": "image/jpeg", "type": "file", "src": "{{filePath}}" }],
Re import the collection.json back in postman.make sure your files to upload are in your local postman working_directory.
I have tried but get the same error each time
" Form param document
, file load error: "pdf", no such file "
code: "key": "document", "type": "file", "src": "{{pdf}}"
Inside postman the VALUE field has {{pdf}} in white, written inside the usualy file-name box deletable with x.
Any solution appreciated.
App Details:
Postman for Windows Version 5.3.0 win32 10.0.15063 / x64
Feature Request:
When a request includes a file to upload, I'd like to be able to set the name of the file through a variable and/or in the pre-request script. Currently, when I set the body to 'form-data' and add a key with the type 'file', the only way to set the file to upload is through the file picker. It would be useful to use an environment variable to set the filename (for example, the API I'm testing requires a new file name for every request to avoid erroneous duplicates).