I've a wired problem in my project, I'm trying to file stream some .acc format by ASP.net and it works perfectly fine in some files (which I realized for file size less than 1 megabyte it seems work fine), but in many cases browser player pretend loading file but it didn't. Also run the project with no error and it works as the same for all files. here is my code:
int bufferSize = 1000;
byte[] buffer = new byte[bufferSize];
using (var fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
{
int totalSize = (int)fileStream.Length;
while (totalSize > 0)
{
int count = totalSize > bufferSize ? bufferSize : totalSize;
int sizeOfReadedBuffer = fileStream.Read(buffer, 0, count);
await outputStream.WriteAsync(buffer, 0, sizeOfReadedBuffer);
totalSize -= sizeOfReadedBuffer;
}
}