Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 views
in Technique[技术] by (71.8m points)

html - How to manage image pasting from clipboard in html5?

On Documentum Eroom App, IE is capable of automatically uploading image from clipboard pasting whereas Firefox can't.

So I wonder if html5 supports that kind of behavior (not just drag and drop of image/file from explorer).

Update: granting access is not enough it's also about being able to handle BINARY data not just TEXT does current firefox can handle binary I can't see it maybe it's not explicit ?

It's not about just drag and drop which is widely already implemented on many sites. It's about BINARY FORMAT CLIPBOARD MANIPULATION to save the image from the clipboard to the server without any need to save file and then drag and drop. The process to save the file somewhere is extremely daunting for user so direct uploading from clipboard is really a must time saver.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes, HTML5 has this capability and it is becoming widely implemented. You can handle events from Ctrl+V and get binary image data and do whatever you want with it.

Currently Google Chrome 13.0.782.220 works great. I have a jQuery plugin with a full demo illustrating the feature (be sure to use Google Chrome, I can't guarantee it other browsers)

http://strd6.com/2011/09/html5-javascript-pasting-image-data-in-chrome/

As robertc mentions the Clipboard API spec is becoming standardized, so it should lead to adoption across browser soon enough.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...