File upload from canvas object

I have a user generated canvas object which I am trying to upload as an image but can’t seem to make it work.

Tried converting the canvas to dataUrl, but coudn’t find a way converting it into a file to be uploaded.

I also tried converting to a Blob (https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob), which works fine and seems the way to go, but cannot seem to get it into a file upload. Do I understand correctly that for security reasons it is not possible to infiltrate a blob into the file input form? Or is there another component to use?

What is the best way to go?

Should I use the server connect upload file function or should I use a custom script to upload the file/blob?

Community Page
Last updated: