Dec 02, 2019 04:00 PM|mgebhard|LINK
The code only validates files where the content length is between 0 and 6 bytes. Is this the expected behavior?
if (file != null && file.ContentLength > 0 && file.ContentLength < 6)
IMHO, the use of the while loop is a bit odd and so is the use of Path.Combine which does not combine a path. Then later when you should use Path.Combine you use string.Format.
I recommend running your code through the Visual Studio debugger.