如何使用输入文件类型在JavaScript客户端和服务器端 [英] How to use input file type in javascript client side and server side

查看:211
本文介绍了如何使用输入文件类型在JavaScript客户端和服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的输入文件=类型,我想priview图像,然后在服务器端使用的图像细节。

I use input file="type" and I want to priview the image and then to use this image details in server side..

这是priview的形象,但我不能在服务器端使用它,就摆在DB:

This is priview the image but I can’t use it in server side, to put in db:

<input type="file" name="image_file" id="image_file" onchange="fileSelected();"/>

如果我做的:

<input type="file" name="image_file" id="image_file" onchange="fileSelected();" runat="server"/>

所以我没有得到一个preVIEW形象。

So I don’t get a preview image.

我尝试IMAGE_FILE价值的新的输入型复制=TEXTimage_file2是这样的:

I try to copy image_file value to new input type="text" image_file2 like this:

<input type="file" name="image_file" id="image_file" onchange="fileSelected();"/>
<input type="file" name="image_file2" id="image_file2" runat="server" onchange="document.getElementById('image_file') = this;"/>

但它不工作...

But it’s not working...

我该怎么办?

推荐答案

如果我理解正确

http://blueimp.github.io/JavaScript-Load-Image/

http://stackoverflow.com/a/4459419/995762

这篇关于如何使用输入文件类型在JavaScript客户端和服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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