我需要一个控制器来处理文件上传。是否可以让处理程序直接将文本打印到页面而不是 return view(); ?
public ActionResult Upload(HttpContext context)
{
HttpPostedFile file = context.Request.Files["fileData"];
Guid userGuid = (Guid)Membership.GetUser().ProviderUserKey;
string userID = userGuid.ToString();
string targetLocation = "D:\\inetpub\\wwwroot\\RTDOTNETMEMBER\\audio\\songs\\mp3\\" + userID + "\\" + file.FileName;
file.SaveAs(targetLocation);
Response.Write("Testing");
}