'Postman - File name from "Send and Download"
In Postman, how can I control the name of the file that is downloaded from using the "Send and Download" option? It is always "response" but I want it to be the actual name of the file that is sent over.
Solution 1:[1]
Response is not your fault. This issue is being actively worked on. Currently, it will not respect your headers in the response.
You can track this issue here: https://github.com/postmanlabs/postman-app-support/issues/2082
Solution 2:[2]
I just looked this up in Google and it seems they still haven't added this option in Postman.
Here's the Github issue, and it's last updated 4 days ago.
https://github.com/postmanlabs/postman-app-support/issues/2082
Hope this will be helpful for someone who is coming across this page.
Solution 3:[3]
Postman has resolved this issue; by modifying the 'Content-Disposition' response header in your server you can control the name of the downloaded file.
Sample rails code:
def show
if request.headers['Accept'] == 'application/pdf'
send_data @document.read_file(:pdf)
# response.headers['Content-Disposition] == "attachment" # send_data sets this initially
response.headers['Content-Disposition'] += '; filename="document.pdf"'
else
respond_with @document, params
end
end
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | John Lippson |
| Solution 2 | Nimeshka Srimal |
| Solution 3 | Devon Parsons |
