0
我試圖創建一個簡單的帖子中,我使用的提供商託管應用程序在SharePoint Online上還附加一個形象,我不能夠在控制器中HttpContext.Request得到SPHostUrl ,我的意思是HttpContext.Request中缺少SPHostUrl。提供商託管asp.net MVC應用程序上傳文件
[HttpPost]
public ActionResult Contact(SimplePostModel model,HttpPostedFileBase file)
{}
查看
@using (Html.BeginForm("Contact","Home",null,FormMethod.Post,new { enctype= "multipart/form-data"}))
的問題是,如果我送這部分new { enctype= "multipart/form-data"}
鑑於上述聲明,我沒能獲得SPHostUrl參數HttpContext.Request。
如果我不發送HTML屬性然後我能夠得到SPHostUrl參數HttpContext.Request。沒有html屬性我也無法上傳文件。
在此先感謝您的幫助。