Problem: I have file named by their Id from database. And when somebody want to downaload it I need to change it to it's real name. File on the server looks for example like: http://localhost:34256/Content/uploads/23. So for example my file name is 23 but i need to change it to textfile1.txt.
I have created a partial view with list of those files:
@foreach (var item in Model)
{
<a href="/Content/uploads/@item.Id" title="@Html.Encode(item.FileName)">
<img src="@item.IcoSrc" /><br />
@item.FileName
</a>
}
Where @item.FileName
is real name of file. When somebody download file from this list, he get's file named @item.Id and not @item.FileName. How can I change it?
I am using MVC3 and .NET framevork 4.
Any help much appreciated!