如何发送一个文件,以使用ASP.NET MVC控制器行动布劳尔? [英] How to send a file to the brower using ASP.NET MVC controller action?

查看:89
本文介绍了如何发送一个文件,以使用ASP.NET MVC控制器行动布劳尔?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,我让我的用户上传任何类型的文件。我将它保存在服务器上的文件系统。该applciation将仅由两个用户访问,所以我并不需要担心上传任何狡猾的文件。

I have an application where I allow my users to upload a file of any type. I save this in the file system on the server. The applciation will only be accessed by two users , so I don't need to worry about uploading any dodgy files.

我如何让我的用户preSS MVC的表单上的按钮来请求该文件通过浏览器发回,并节省$ P $与标准psented /打开dailog?

How do I allow my user to press a button on an MVC form to request the file be sent back via the browser and be presented with the standard save/open dailog?

我要回任何类型的文件,而且我一直觉得这个例子指定返回的文件类型。是否有这样一个简单的例子?

I want to return any type of file, and the example I've found always specify the type of file being returned. Is there a simple example of this?

谢谢! :)

推荐答案

请参阅的 FileResult 和派生类。

这篇关于如何发送一个文件,以使用ASP.NET MVC控制器行动布劳尔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆