SixString Posted January 28, 2004 Posted January 28, 2004 Hi :) How do i bind an image to a inputfile ...so that when a user selects a image from the hard disk that image is displayed in the browser ? Thanks in advance Cheers Quote
bungpeng Posted January 29, 2004 Posted January 29, 2004 It is good ideas, but I never seem any web site do that. In normal way, you can't do this, because the image file in client harddisk, server cannot access client harddisk to display the image, even scripting languages like javascript also can't do that. It is due to security issue. Because if you can display image from user harddisk, mean you can do anything in your user harddisk, like delete a file... But you can do it using ActiveX control if user agree to install your ActiveX control in their machine (automatic install). Quote
Bodybag Posted January 29, 2004 Posted January 29, 2004 You should be able to do this in javascript.I think.Just give them a textbox where they type in the path and change the src of a img tag. Quote Programmers are trying to create bigger and beter idiot proof programs.The universe is trying to create bigger and beter idiots and so far the universe is winning.
Bodybag Posted January 29, 2004 Posted January 29, 2004 This works. <HTML> <input type='textbox' id='txtimage'> <input type='button' onclick='document.getElementById("im").src = document.getElementById("txtimage").value' > <img id=im src='d.gif'> </HTML> Quote Programmers are trying to create bigger and beter idiot proof programs.The universe is trying to create bigger and beter idiots and so far the universe is winning.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.