Add image from database


I have just started using the ipfs javascript but am struggling getting it to display in ipfs,io/ipfs as an image. It just displays as text.

The code I am using is:

const ipfs = await Ipfs.create();
const myFile = {
    path: 'image01.png',
    content: window.btoa(S)
const { cid } = await ipfs.add(myFile);

S is a base64 string.

This is the link

How can I force this to display as a png.

Thanks in Advance.