The last time Insus.net had the ability to upload files in an MVC application The MVC application shows uploaded pictures http://www.cnblogs.com/insus/p/3597543.html
There are uploads to download. This blog post is to display the uploaded file as a list of view views, then the user can click to download.
For more information, I suggest you look at the link first.
In the entity directory of the MVC application, locate and open FileLibraryEntity.cs and add a method to return the DataTable:
The #1写一个GetUploadFileByPrimarykey (filelibrary FL) function returns a DataTable in order to pass in the primary key and obtain relevant file information from the database.
#2 and #3 modified place, and this article has no relationship, insus.net just see the code redundancy, random refactoring just.
Next, customize a result, called Downloadresult, this class has inherited Contentresult class, also need override Executeresult () method:
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/