1. 首页
  2. 课程学习
  3. .Net
  4. FileUpload 文件上传组件的ASP.NET实例

FileUpload 文件上传组件的ASP.NET实例

上传者: 2019-04-14 18:46:17上传 RAR文件 448.77KB 热度 48次
关于大附件上传的插件,试了才知道![System.Web.Services.WebMethod] [System.Web.Script.Services.ScriptMethod] public static object GetUploadStatus() { //获取文件长度 UploadInfo info = HttpContext.Current.Session["UploadInfo"] as UploadInfo; if (info != null && info.IsReady) { int soFar = info.UploadedLength; int total = info.ContentLength; int percentComplete = (int)Math.Ceiling((double)soFar / (double)total * 100); string message = string.Format("上传 {0} ... {1} of {2} 字节", info.FileName, soFar, total); // 返回百分比 return new { percentComplete = percentComplete, message = message }; } // 还没有准备好... return null; } { int soFar = info.UploadedLength; int total = info.ContentLength; int percentComplete = (int)Math.Ceiling((double)soFar / (double)total * 100); string message = string.Format("上传 {0} ... {1} of {2} 字节", info.FileName, soFar, total); // 返回百分比 return new { percentComplete = percentComplete, message = message }; } // 还没有准备好... return null; }
用户评论
码姐姐匿名网友 2019-04-14 18:46:17

资源一般,说明不够详细