How to send a user generated image to the server using js, ajax or fetch ()?
Good day. There was such a problem: 1) The user draws a picture on canvas, the program converts it into a picture (png). It is necessary that this picture be sent to the server without reloading the page, so that later you can open it on the website page using a link.
2) User records audio. It is sent to the server without reloading the page, and then it was also possible to refer to this audio file by the link.
Please explain and provide the code.
I have already answered a similar question. Here in the answers there is a function for sending blobs to the server:
How to get an audio file from the site?
For images, learn more about how to get a Blob using Canvas:
To place the code, please use CodePen or similar tool. Thanks you!