How to save screenshot API to my folder

How can I save getScreenshot() . image to my folder with a button?