I have the below code for saving an image from a byte array.
I am able to save the image successfully using the below code.
Currently I am saving image with
Would you use the prefix header data:image/png;base64
of the base64 image data?
From the RFC, the "data" url definition:
### Form : `data:[][;base64],`
### Syntax:
`dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
mediatype:= [ type "/" subtype ] *( ";" parameter )
data := *urlchar
parameter := attribute "=" value`
Samples:
data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw......
Then you can get the extension with gif.