1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added content size to podcast download

This commit is contained in:
Uncled1023 2017-02-09 23:15:42 -08:00
parent e5b8533e33
commit 679c148029
2 changed files with 2 additions and 18 deletions

View File

@ -89,10 +89,9 @@ namespace Teknik.Areas.Podcast.Controllers
if (System.IO.File.Exists(file.Path))
{
FileStream fileStream = new FileStream(file.Path, FileMode.Open, FileAccess.Read);
// Read in the file
//byte[] data = System.IO.File.ReadAllBytes(file.Path);
// Create File
Response.AddHeader("Content-Length", file.ContentLength.ToString());
var cd = new System.Net.Mime.ContentDisposition
{
FileName = file.FileName,

View File

@ -42,21 +42,6 @@ namespace Teknik.Utilities
bytesRemaining -= processedBytes;
}
while (processedBytes > 0 && bytesRemaining > 0);
if (bytesRemaining > 0)
{
// Clear the buffer
Array.Clear(buffer, 0, chunkSize);
// Finalize processing of the cipher
processedBytes = stream.Read(buffer, 0, bytesToRead);
if (processedBytes > 0)
{
// We have bytes, lets write them to the output
response.OutputStream.Write(buffer, 0, processedBytes);
response.Flush();
}
}
}
catch (HttpException httpEx)
{