You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constfileInput=document.querySelector('input[type="file"]')asHTMLInputElement;// Create a new File objectconstmyFile=newFile([imageDefault],'myFile.txt',{type: 'text/plain'});constdataTransfer=newDataTransfer();dataTransfer.items.add(myFile);fileInput.files=dataTransfer.files;
Do anyone have some code example? Thank you.
The text was updated successfully, but these errors were encountered:
I just ran into the same problem. For anyone who wants to load an image from an url:
consturl='https://dummyimage.com/458x340/000000/9b1bdb.png';fetch(url).then(response=>{// Check if the request was successful (status code 200)if(!response.ok){thrownewError(`Failed to fetch data from ${url}`);}// Convert the response body to a Blobreturnresponse.blob();}).then(blob=>{conste={target: {files: [blob,]}};this.$refs.editor.uploadImage(e);});
First at all, great project and nicely done. Much appreciated.
I'm trying to use
uploadImage(e)
but I get:I'm not sure if
e
is supposed to be an URL, data, or what.I tried with an URL but didn't work:
I tried with the image as base64 below but didn't work either:
Also I tried by assigning the base64 string to an image but no luck:
I also tried to pass it as FileReader with the base64 content, but didn't work either:
Also, I tried like this:
Do anyone have some code example? Thank you.
The text was updated successfully, but these errors were encountered: