File without extension

0

I have an application that streams an audio file on a page, but when trying to download it the file comes with no extension.

Here is the code I use:

   public HttpResponseMessage Get(string filename)
    {
        AudioSteam audio = new AudioSteam(filename);

       var response = Request.CreateResponse();
        response.Content = new PushStreamContent(async (Stream outputStream, HttpContent content, TransportContext context) =>
        {
            try
            {
                var buffer = new byte[65536];

                using (var video = File.Open(audio._filename, FileMode.Open, FileAccess.Read))
                {
                    var length = (int)video.Length;
                    var bytesRead = 1;

                    while (length > 0 && bytesRead > 0)
                    {
                        bytesRead = video.Read(buffer, 0, Math.Min(length, buffer.Length));
                        await outputStream.WriteAsync(buffer, 0, bytesRead);
                        length -= bytesRead;
                    }
                }
            }
            finally
            {
                outputStream.Close();
            }
        });

        return response;
    }

Follow the image of the downloaded file on my via my page.

As you can see the file comes with the name download and without the extension, as an implement for which it has the original name of the file and the extension?

    
asked by anonymous 06.07.2018 / 15:54

0 answers