我们如何在图像框中显示该上传图像 [英] how can we display that upload image in image box

查看:76
本文介绍了我们如何在图像框中显示该上传图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生

我在项目中上传图像,我的要求是上传后,该图像显示在图像框中,但是一旦我们单击刷新按钮而没有按下刷新,该图像就可以在解决方案资源管理器中看到.如何显示/如何刷新该解决方案以编程方式浏览器
我会等你的答复..
忠心感谢您的
m.koteswararao

sir

i am upload image in my project my requirement is after upload that image is displayed in the image box but that image is visible in solution explorer once we click the refresh button with out press the refresh how can i visible / how can we refresh that soltion explorer programatically
i will wait for your reply..
thanking you yours faithfully
m.koteswararao

推荐答案

您可以按照以下方式使用JavaScript

you can use javascript as per below

<script language="javascript">
var imgRe = /^.+\.(jpg|jpeg|gif|png)


/i; 函数showImage(obj) { var path = obj.value; 如果(path.search(imgRe)!= -1) { document ['image'].src ='file://'+ path; } 别的 { alert(仅限JPG,PNG和GIF!"); } } < /script > < html > < 输入 =" span> 名称 =" span> 大小 =" span> onchange =" / > < br > < img =" 图片" > < /html >
/i; function showImage(obj) { var path = obj.value; if (path.search(imgRe) != -1) { document['image'].src = 'file://'+path; } else { alert("JPG, PNG, and GIFs only!"); } } </script> <html> <input type="file" name="myImage" size="30" onchange="showImage(this)"/><br> <img name="image"/> </html>


这篇关于我们如何在图像框中显示该上传图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆