文件上传并提取其内容并在视图mvc4中显示

时间:2015-06-01 12:01:03

标签: asp.net-mvc

任何人都知道一步一步执行上传任何类型的文件说文本文件并获取从中提取的内容,并在其他视图中显示该内容。如果有人可以,请让我知道所有步骤......

1 个答案:

答案 0 :(得分:-1)

    You can achieve this by following below steps

   //Controller
    public ActionResult GetContent(string path)
    {
       return new FilePathResult(path, "application/octet-stream");
    }

    //View
    @Html.Action("GetContent","ControllerName", new { path = "~/path_of_the_file"" });