web前端|js教程
+jquery.form,上传,异步
web前端-js教程首先我们需要做准备工作:
网站源码 安卓,调整ubuntu终端字体,爬虫攻击真实案例,sugarcrm php,金昌seo排名lzw
jquery 点击此处本站下载。
ce3 源码网盘,mac安装ubuntu视频,爬虫数据比对存储,php ffmpge,武汉开心seolzw
jquery.form.js 点击此处本站下载。
php电影源码下载,ubuntu磁盘挂载mnt,php 爬虫多线程,php mpos,seo标题教程lzw
页面JqueryFormTest.aspx:
,着必须要把去除掉才能在低版本ie显示data = data.replace("
", "").replace("
", "");$("#pimg").append("");//清空file控件里面的值var file = $("#btnfile");file.after(file.clone().val(""));file.remove();} }); }); })
img.ashx:
using System;using System.Web;public class img : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; //获取上传的文件的对象 HttpPostedFile img = context.Request.Files["btnfile"]; //获取上传文件的名称 string s = img.FileName; //截取获得上传文件的名称(ie上传会把绝对路径也连带上,这里只得到文件的名称) string str = s.Substring(s.LastIndexOf("\\") + 1); string path = "~/upload/"+ str; //保存文件 img.SaveAs(context.Server.MapPath(path)); //HttpRuntime.AppDomainAppVirtualPath主要是获取应用程序虚拟路径名称,因为响应给页面时不会自动添加而导致无法显示图片 context.Response.Write(HttpRuntime.AppDomainAppVirtualPath + path.Substring(1));//path.Substring(1)用来去除第一个~字符 } public bool IsReusable { get { return false; } }}