Upload/paste image into div element such as messenger textbox

How can you upload or paste a previously saved/copied to clipboard image into a div element such as the textbox in messenger in instagram or facebook?

You can use Keyboard → Send Keys and send CTRL + C to copy and send CTRL+V to paste. Keyboard package simulates the keyboard typestrokes, so everything should work like you are manually doing it.