How does pasting an image work, e.g. when composing a PF post?

  • Context: JavaScript 
  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Image Work
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 2K views
Swamp Thing
Insights Author
Messages
1,062
Reaction score
819
TL;DR
How to implement this thing where you can paste an image when composing a post on Physics Forums?
I have pasted the image below after copying it from my desktop. The image becomes visible in the Post Composer as soon as you paste it. It also works if you copy from another web page.

I assume that JavaScript is able to grab the data from the clipboard and create an IMG element on the fly, and also send the IMG data to the PF server. It can also create a thumbnail version.
How to code these functions?
1564358555005.jpeg
 
Physics news on Phys.org