Telerik-UpLoad

 

1.form表单需要注意的地方

  <form method="post" action="" enctype="multipart/form-data" ></form>

2.后台接收

  IEnumerable<HttpPostedFileBase> attachments 直接foreach即可

  

   //自定义文件名称,保证不会名称冲突
  fileName = DateTime.Now.ToString("o").Replace("-", "").Replace(":", "").Replace(".", "").Replace("+0800", "")+"@@" + fileName;
  //文件路径拼接,获取系统路径   
var physicalPath = Path.Combine(Server.MapPath("~/UpLoad/BusinessAdvice/"), fileName);   file.SaveAs(physicalPath);

 

 

@(Html.Telerik().Upload()
        .Name("attachments")
        .Async(async => async
        .Remove("Remove", "BmpForm111"))
        //.ClientEvents(e => e.OnSelect("OnLoadFiles"))
         .Multiple(false)
)

 

posted on 2015-04-12 22:13  忙碌ing  阅读(239)  评论(0)    收藏  举报

导航