My API requires an image to be posted to it as a file. Currently, I have an image in base64 format that is generated by a custom image creator.
I understand that if my form had a basic input
with the type
of file
I could use new FormData()
and then do something along the lines of formData.append('file', myFile)
.
How can I post this base64 encoded image as an image file to my API via jQuery asynchronously?