0

How can I upload an image, but without using filefield in EXTJS? So the image is not loaded through filefield, and I do not have its src url. Instead, the image is actually a capture from video file, and it is given as:

canvas.getContext('2d').drawImage(video, 0, 0, video.videoWidth, video.videoHeight);

Sap1234
  • 147
  • 7
  • This has nothing to do with Ext-JS? It doesn't seem like you have tried anything. Please see https://stackoverflow.com/questions/13198131/how-to-save-an-html5-canvas-as-an-image-on-a-server and ask another question if you still can't figure it out, showing the code you are using to try to send the image to the server. – Ruan Mendes May 21 '21 at 12:20
  • Yes, this is what I tried, but I got an error: Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. – Sap1234 May 21 '21 at 12:28
  • If that's what you tried, that's what your question should have mentioned including the code you used and where the video is coming from. It likely means that what you have drawn on the canvas came from another origin which means you can't export since it would be a security hole. See https://garyrafferty.com/software/Tainted-Canvas/ and https://stackoverflow.com/questions/22710627/tainted-canvases-may-not-be-exported – Ruan Mendes May 21 '21 at 14:14
  • Thank you Juan. But it seems almost impossible to get any answer because my question is closed before any can give me an answer. i created another question and put some code into it, but the new question is also closed. Yes, canvas is rendered from video. i woul like to upload video thumbnail, but I cannot figure out how. https://stackoverflow.com/questions/67638088/problem-with-canvas-todataurl-only-when-canvas-is-drawn-from-video?noredirect=1#comment119554379_67638088 – Sap1234 May 21 '21 at 16:08
  • Is your video from a different origin? The reason they are closed is because very similar questions were already asked and answered. If you don't think your question is a duplicate, you can make a case in the comments and others would re-open it. You haven't made a case yet, you have a problem but you haven't been able to hone in enough to be able to ask a question that is a good fit for StackOverflow, it is not clear how your question is different from the duplicates – Ruan Mendes May 21 '21 at 17:39

0 Answers0