hi @jmartland22 you can create a file from the dataUrl then append that to the form you are trying to submit or add the file to an input. here is a sample code you can use use.
This is what i’m currently using to create an image file from base64 encoded and upload to the server.
function dataURLtoFile(dataurl, filename) {
var arr = dataurl.split(','),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], filename, { type: mime });}
then you can do something like
const imgFile = dataURLtoFile(base64 encoded, "image.{ext}")
const dataTransfer = new DataTransfer();
dataTransfer.items.add(imgFile);
//this will add the file to your multiple files upload input
const fileInput = document.getElementById('yourImgInput');
fileInput.files = dataTransfer.files
The submit form.
You can read more here
or just create a file from existing images then upload
@scalaris thanks for tagging me to this