Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paste image from clipboard to web form

I see that this has been discussed a few times before, but that was 2010 and before. Now i was writing a new email in my gmail client and noted that i could just paste an image into the mail body / webform.

I was quite happy to see this as i have been looking for a similar solution for a while.

Can anyone provide some details on how this works? Is it Flash? Or some JavaScript?

like image 807
Tys Avatar asked Apr 20 '12 18:04

Tys


People also ask

How do I paste an image into an online form?

In Microsoft Forms, open the form you want to edit. Select the question to which you want to add a picture. Select Insert media (picture icon) on the right side of the question. In the Insert media pane, select Image.

How do I copy and paste an image in HTML?

3. Copy and paste your image URL into an IMG tag, add a SRC to it. Identify first where you'd like to place your image within the HTML and insert the image tag, <img>. Then take your uploaded image, copy the URL and place it within your img parameters prefaced by a src.

How do you paste an image into clipboard?

If you've put an image in the clipboard by using Ctrl+c or by right-clicking and choosing Copy or Cut, then you paste that image by using Ctrl+v or Paste in whatever location you want the copy to go.

How do you paste a screenshot in HTML?

Images can be easily inserted at any section in an HTML page. To insert image in an HTML page, use the <img> tags. It is an empty tag, containing only attributes since the closing tag is not required. Just keep in mind that you should use the <img> tag inside <body>…


3 Answers

It is html5 + javascript, and or flash (depends on the browser) This link should get you strated: http://strd6.com/2011/09/html5-javascript-pasting-image-data-in-chrome/

A little warning though, this only works in chrome as of now.

like image 182
mpx Avatar answered Oct 09 '22 12:10

mpx


Here is another alternative, inspired by Github's image paste. Seems to work with jQuery.

https://github.com/Rovak/InlineAttachment

like image 36
micho Avatar answered Oct 09 '22 10:10

micho


From 2011 (which might be a bit out of date now) this link might be a great starting point for Chrome + Firefox:
http://joelb.me/blog/2011/code-snippet-accessing-clipboard-images-with-javascript/

(from the guy who built Pasteboard)

With IE (if anyone still needs to support IE) it sounds like you might need to resort to HTA, ActiveX, Flex, or Java. Have a look here:
Take a screenshot of a webpage with JavaScript?

like image 32
Simon East Avatar answered Oct 09 '22 10:10

Simon East