Following code snippet fetches the image from an URL and converts the blob to a base64 string before saving the file to the file system. (Saving the file to the file system can be considered being additional boilerplate as a conversion from a blob to a base64 string is not needed to save a file to the file system. See second example.)
The code snippets shows how to:
- download an image from a server
- convert image to a base64 string
/**
* Fetches an image from given URL.