Automate to convert base64 decoded value to PDF file and download it to pc

Hi, how to automate the decode base64 code and save as a pdf in postman and download it to the desire location. Thanks in advance

Hi @azhagupattabi!

Welcome to the community! :clap:

I see you posted this comment on my video as well. I’ll leave the same response here:

So this isn’t exactly possible within Postman, at least to my knowledge. In the Postman Tests section, the node js module β€œfs” isn’t accessible, and therefore Postman doesn’t have a way, or privileges to write to the file system. There are different ways you can overcome this, such as with your own local web service, but natively in Postman, it’s not possible.

However, you can use Postman newman to do this, where you can import the fs module, and write the resulting file to a file location.

https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/#:~:text=Newman%20is%20a%20command%20line,integration%20servers%20and%20build%20systems.

In addition, there may be other ways you can accomplish this. I’d suggest searching in the forum here to find other possible solutions.

Hope this helps!

Best,
Orest

1 Like