Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving binary responses as a file results in base64 #634

Closed
CMircea opened this issue Jul 12, 2014 · 14 comments
Closed

Saving binary responses as a file results in base64 #634

CMircea opened this issue Jul 12, 2014 · 14 comments
Labels

Comments

@CMircea
Copy link

CMircea commented Jul 12, 2014

If I make a request to a server and the server replies with binary content (such as application/pdf), Postman asks me to save it as a file. If I do that, the file doesn't contain the actual bytes, but a base64 string. This only happens if the interceptor extension is enabled.

@a85
Copy link
Contributor

a85 commented Oct 6, 2014

Can you try using the "Send and download" option with the Interceptor on?

@abhijitkane
Copy link
Member

Works as expected with 'Send and download'
@CMircea Click on the arrow next to the Send button > 'Send and download'

@CMircea
Copy link
Author

CMircea commented Oct 10, 2014

Yes, "Send and download" works fine. I believe back in July that did not exist though.

@a85 a85 added the bug label Feb 5, 2015
@igauravsehrawat
Copy link

How does "Send and download" works? can anyone help me with internal details?

Cheers

@abhijitkane
Copy link
Member

'Send and download' makes the XHR request with responseType set to "arraybuffer", which returns the data as binary.

@igauravsehrawat
Copy link

@abhijitkane thanks for the elegant solution. Used blob further to complete the function.

@gautamwa
Copy link

Thanks, Postman is too cool. Save me tons of time

@swapnilpatne
Copy link

How to handle file download request from Newman? Can someone please answer?

Postman's 'Send and download' doesn't handle it quite gracefully as I can see filename returned in response header along with file type whereas Postman simply opens up save as window without providing the actual file name returned from server as if Postman doesn't know what file was returned from server.

@manishagr83
Copy link

How can we find out what is internally done in Send and Download and replicate the same in JAVA code. Send and Download is working perfectly for me but when run from JAVA it is writing JUNK to the file in local

@daniel2xo
Copy link

Any shortcut for "send and download" in the GUI ?

@sdnts
Copy link

sdnts commented Jan 12, 2017

@daniel2xo As of now, no. But we're working on a release that has buffed shortcuts. I'll add it there. Will let you know here when it is out.

@daniel2xo
Copy link

Thanks @madebysid for reply, actually i dont know how to create a java file to call an api and get save the respond repeatedly, so wish to have a shortcut for that.

@jguziejka
Copy link

this is still an issue, had to turn off Interceptor for the PDF to be created correctly...

@shsowmya
Copy link

shsowmya commented Jun 2, 2019

Hi,
I have the same need to save the response body as zip file while running in the collection runner. How can I achieve it using script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests