I have been reading and working around downloading and uploading files to database! I just made upload work, so now i save my files in Binary in the database! Also i display the name in the View :
@model IEnumerable<RH_Files>
<div class="tableContainer">
<table class="table table-striped">
<thead>
<tr>
<th>
@Html.DisplayNameFor(p => p.Name)
</th>
</tr>
</thead>
<tbody >
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(model => item.Name)
</td>
</tr>
}
</tbody>
</table>
</div>
my model:
public class RH_Files
{
[Key]
public int id { get; set; }
public string Name { get; set; }
public string ContentType { get; set; }
public Byte[] Data { get; set; }
}
Now what i need, is to have a download button for each item, that will trigger a c# action that downloads the file selected...
Any help is appreciated!!