2009-09-15 61 views

回答

2

有關於大型文件和WCF的MSDN文章。 Large Data and Streaming 在你不得不增加了maxRequestLength WCF服務的web.config文件(上maxRequestLength

描述的觀點應該是這樣的

<%using(Html.BeginForm("ActionName", 
         "ControllerName", 
         FormMethod.Post, 
         new {enctype = "multipart/form-data"})) {%> ... 

控制器看起來應該像下面

[AcceptVerbs(HttpVerbs.Post)] 
    public ActionResult ActionName(HttpPostedFileBase file) 
    { 
     ....