以 HTML 格式显示来自客户端的图像
I was unable to display local images in both IE6 and IE7. Below is a page where you can see a demo:
http://www.thaiperfect.com/anytest/
Any advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您需要从服务器而不是本地计算机引用图像。因此,如果您将图像上传到
http://www.thaiperfect.com/anytest/arrowup.jpg
,那么您可以使用以下命令将其显示在页面上: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:您无法访问客户端计算机上的内容。我想这会是非常没有安全感的。你为什么想做这个?也许您应该尝试为用户提供上传图像的可能性。您应该查看本教程。
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.
有人告诉我答案可能在两个链接中
http://www.dslreports。 com/forum/r20721070-IE-IE-7-can-not-browse-local-files
http://www.phdcc.com/xpsp2.htm#securityoptions
但我没有找不到答案
而且我没有提出我原来的问题。
15:01 16/2/2010
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
将图像上传到您的服务器,然后显示该位置的图像。您无法使用 JavaScript 访问本地计算机文件,因为这是一个安全问题。
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.
您不能将来自用户计算机的图片嵌入到您的网站中。路径
c:\_topuponline\arrowup.jpg
仍将在服务器中而不是在用户的电脑中查找图像。您可以做什么,要求用户将图片上传到您的服务器,然后显示它。
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.