title: convert data:application/xml base64 to a image URL
body: <p>I have a protected image URL that points to a jpeg in <code>amazon s3</code> and that URL works only on our website. now I need to convert that protected URL to a public image URL. so I
  have converted that URL to base64 and I have got the base64 output with <code>data:application/xml</code> and it wasn't working when I tested that base64 with <code>&lt;img&gt;</code> tag even though I have changed <code>data:image/jpeg</code>.
  so I need a way to convert that protected URL or base64 to a public image URL. any help is very much appreciated.</p>
  <p>I have tried this <code>https://stackoverflow.com/questions/41778434/javascript-convert-an-url-to-a-base64-image</code></p>
  <p>protected URL:</p>
  <p><code>https://dqedge1.s3-ap-south-1.amazonaws.com/uploads/answers/5f47bc0094c80bcd110ad26a/5ec553ceb74af11047f00062/answer/1630903224748.jpeg</code></p>
  <p>base64:
  <code>data:application/xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPEVycm9yPjxDb2RlPkFjY2Vzc0RlbmllZDwvQ29kZT48TWVzc2FnZT5BY2Nlc3MgRGVuaWVkPC9NZXNzYWdlPjxSZXF1ZXN0SWQ+WjdBTTAwUjU0VzY1MkNOQzwvUmVxdWVzdElkPjxIb3N0SWQ+Q05GV1ZkNHV3amY5NGZaajlMNHpEMi85R2ovdUwyUW9nM0hEUEhzOWlDOUhtclpQTGNpaUdXenY4ajRNSkNqU29NZ0ZNbTdRVUQwPTwvSG9zdElkPjwvRXJyb3I+</code></p>
  <p><a href="https://i.stack.imgur.com/pQ6up.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pQ6up.png" alt="demo" /></a></p>