如何preVIEW一个图像上传到服务器之前? [英] How to preview a image before uploading it to the server?

查看:88
本文介绍了如何preVIEW一个图像上传到服务器之前?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会增加产品到网上商店的形式,并含有这么多的领域

I have a form that will adding the product to the online store, and contains this many fields

1)产品名称

2)产品code

3)产品说明

4)产品价格

5)产品图片

现在我想,当用户/管理员选择一个图像使用asp.net的文件上传控件,选择将显示在图像控制产品形象之后,之前的用户将上传到服务器。

now i wanted that while user/admin select a image using file upload control of asp.net, after selecting product image that will be displayed in image control before the user will upload that to the server.

所有我需要的是preVIEW的图像前,将上传到服务器,它会通过使用任何上述的JavaScript,jQuery的,阿贾克斯或C#

all i need is to preview that image before it will uploaded to the server, it will be by using any of these javascript, jquery, Ajax or c#

请帮我...

预先感谢。 特加斯Vaishnav

Thank in Advance. Tejas Vaishnav

推荐答案

C#在服务器上执行,因此图像必须是已经在那里了。

C# executes on the server so the image has to be already there.

JavaScript和jQuery的运行客户端,所以你可以有两个更多的运气(其实jQuery是只是一个在JS引擎在浏览器顶部JS库)。

Javascript and jQuery run client-side so you could have more luck with these two ( in fact JQuery is just a JS library on top of the JS engine in the browser ).

你为什么不使用浏览器的开/选择文件的对话框反正在preVIEW功能?

Why don't you use the preview feature of the browser's open/select file dialog anyway?

这篇关于如何preVIEW一个图像上传到服务器之前?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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