I have an MVC Web application in which it picks up an audio stream according to the received parameters:
public new ActionResult File(string q, string url)
{
try
{
var query = new GetFileQuery()
{
q = q.Substring(0, 8),
sequencial = q.Substring(8),
path = url
};
if (query.q == query.Hash1)
{
string contentType = MimeMapping.GetMimeMapping(query.fileName);
var cd = new System.Net.Mime.ContentDisposition
{
FileName = query.fileName,
Inline = true,
};
Response.AppendHeader("Content-Disposition", cd.ToString());
query.ConvertWavMP3(query.path);
File(
query.fileBytes
, contentType);
}
}
catch (Exception e)
{
}
return View("Index");
}
But I need this audio to be only for viewing without the download option and it is in an audio tag , as I call that file in the tag and block the option of download?