在客户端上传和preVIEW图像而没有回发 [英] Upload and preview image in client side without posting back
问题描述
我需要上传一个图像,然后preVIEW它不回发,因为我需要有一个文件上传控件(即使HTMLinputfile或ASPfileupload),那么用户将浏览选择后(浏览),选择图像会有一个按钮(HTMLInputButton),将节省上传的图片和preVIEW它。
I need to upload an image and then preview it without posting back as i need to have a file upload control(even HTMLinputfile or ASPfileupload) then the user will browse to select image after selecting (browsing) there will a button(HTMLInputButton) that will save the uploaded image and preview it.
我有以下的code:
<div>
<input id="UploadInput" type="file" value="Upload" />
<br />
<input id="PreviewBtnInput" type="button" value="Preview" onclick="ShowPreview()" />
<br />
<img id="ImgUploaded" />
</div>
那么,如何可以做这个任务?
So how can i do this task ?
提前任何答复谢谢,但请,如果任何人有谈这个问题的链接的文章请我需要一个明确的code不是文章的细节。
Thanks in advance for any reply but please if any one has a link for article that talk about this issue please i need a clear code not article details.
推荐答案
您可以使用之前上传下面提到至preVIEW的形象工程。采样工作还附上。
You can use the project mentioned below to preview the image before uploading. Working sample is also attached.
的http://www.dotnetspider.com/resources/40858-$p$pview-Image-before-uploading-using.aspx
本使用AjaxControlToolKit的AsyncFileUploadControl和HttpHandler的上传图片。
This uses AjaxControlToolKit's AsyncFileUploadControl and HTTPHandler to upload the image.
这篇关于在客户端上传和preVIEW图像而没有回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!