MVC 작업에서 다운로드 기능을 만들려고하는데 실제 다운로드가 작동하지만 파일은 actionname과 함께 파일 이름으로 저장됩니다. 아래 코드에서 'DownloadMP3'이라는 파일 이름을 얻습니다. 다운로드시 원본 파일 이름을 유지하는 방법을 아는 사람이 있습니까?파일 다운로드 기능 생성
[Authorize]
public virtual FileResult DownloadMP3(string fileName)
{
//Actions/Download?filename=test
//test
string filePath = @"~/Content/xxxxx/" + fileName + ".mp3";
Response.AddHeader("content-disposition", "attachment;" + filePath + ";");
return File(filePath, "audio/mpeg3");
//for wav use audio/wav
}