Displaying Images from Client-Machine in HTML
I was unable to display local images in both IE6 and IE7. Below 开发者_JAVA百科is a page where you can see a demo:
http://www.thaiperfect.com/anytest/
Any advice?
Upload the image to your server and then show the image from that location. You can't access local machine files with javascript since it is a security issue.
You cannot embed a picture in your website from an users computer. The path c:\_topuponline\arrowup.jpg
will still look for an image in the server not in the usr's pc.
What you can do it ask the users t upload the picture to your server and then display it.
You need to reference the image from your server, rather than your local machine. So if you upload your image to http://www.thaiperfect.com/anytest/arrowup.jpg
then you can display it on the page using:
<img src="arrowup.jpg" height="150" width="174" border="0" alt="..." />
You can't access contents on client's computer. I guess it would be very insecure. Why would you want to make this? Perhaps you should try giving the user the possibility of uploading an image. You should check this tutorial.
some one told me that the answer may be in 2 links http://www.dslreports.com/forum/r20721070-IE-IE-7-can-not-browse-local-files http://www.phdcc.com/xpsp2.htm#securityoptions
but i didn't find an answer furthermore I didn't my original question. 15:01 16/2/2010
精彩评论