Answer the question
In order to leave comments, you need to log in
How to use ClipboardEvent or DataTransfer in safari?
Good afternoon!
I have a task to generate an image from canvas and "shove" it into
And I do it this way:<input type="file" />
function renderPreview(blob, input) {
const fileData = new ClipboardEvent('').clipboardData ||
new DataTransfer();
const file = new File([blob], "img.png", { type: 'image/png' });
fileData.items.add(file);
input.files = fileData.files;
}
ClipboardEvent
, and Edge does not have a constructor File
. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question