'How to get FILE inserted in DraftJS through CTRL + Z?
I'm using DraftJS and it's all working fine, I can save images in my server when user pastes it in the editor, and I can delete then from the server when user for example exits the page without saving the content with the image.
But, if the user inserts an image (now the image is automatically saved in the server), then he erases the image and hit 'save' (now the image is deleted from the server), and then re-inserts the image using CTRL + Z, the image comes back to be displayed in the editor, but at that time I couldn't capture that there was an image inserted, because the image was not pasted.
Currently I can detect pasted files with the handlePastedFiles
attribute in the Editor component. But I am not aware of a way to detect files inserted through another way that is not pasting.
I would need to detect the content inserted with CTRL + Z, then get the FILE inside it (not the url), and then send it again to the server.
How could I do this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|