Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,


Requirement like we need to copy the image from desktop or somewhere in the hard disk and paste into the web page. instead of clicking browse button and select the image.

Please suggest

Thanks.
Posted
Updated 13-Feb-11 18:36pm
v4

Without the help of an activeX (IE) or an appropriate plugin for non-IE browser I'd say this is impossible with standard HTML and javascript.

Cheers!
 
Share this answer
 
Comments
Ali Al Omairi(Abu AlHassan) 13-Feb-11 19:36pm    
Sir, how about my answer?!!
Nish Nishant 13-Feb-11 19:46pm    
The OP wants to paste an image. So you'd have to first write that to a temp file (assuming you can, and that security issues won't crop up), and then show that temp image in the HTML page. And again most new browsers will also prompt the user when they try to copy or paste.
Ali Al Omairi(Abu AlHassan) 13-Feb-11 20:13pm    
me sorry, me no good on englisia.

but any way you should not had to get too hot (calm down, this would kill no body)
Nish Nishant 13-Feb-11 20:17pm    
>> me sorry, me no good on englisia.
but any way you should not had to get too hot (calm down, this would kill no body)<<

It would seem you understand the language even lesser than you imagine. I was not "hot" in any way when I responded to you :-)
Ali Al Omairi(Abu AlHassan) 13-Feb-11 20:30pm    
Sir, your response is freezing to death.
Sir, you can just handel the on paste event of an input:

JavaScript
<script type="text/javascript" >
function DoCopy(imgsrc){
window.clipboardData.setData('URL',imgsrc);
//...
}
function DoPaste(targetimg){
var imgsrc = new String( window.clipboardData.getData('URL'));
targetimg.src = imgsrc;
//do your code
}
</script>
<img onpaste ="DoPaste(this.src);" />
<img oncut ="DoCut(this.src);" />



100 :rose: ;)
 
Share this answer
 
v4
Comments
Espen Harlinn 20-Feb-11 9:01am    
My 5, that's doable in IE, and documented here: http://msdn.microsoft.com/en-us/library/ms536955(VS.85).aspx
Ali Al Omairi(Abu AlHassan) 21-Feb-11 5:26am    
thank you, sir.
J a a n s 21-Feb-11 7:01am    
I don't think that this solution will help the OP to get the image content back in the server.
Ali Al Omairi(Abu AlHassan) 22-Feb-11 11:02am    
Sir, would you please mention the reson.
Please suggest way to proceed using activeX(IE)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900