I have been working on a ASP.NET C# solution to seperate an uploaded file into equal sized blocks for mass storage puposes. To do this I have created a custom Stream class which gets created in an overloaded UploadedFile.CreateStream function. The custom stream class overrides the Write function to write the input data to seperate indexed block files.
The problem is that the resulting uploaded file is being corrupted because what seems to be the request header is being included in the data being written to the stream and is actually replacing the same sized expected data. In other words, the data that describes the file (bitmap header, jpeg header) is being replaced with the request header. The size of the replaced data hovers around 650 bytes. Also, the total file size at the end of the stream is equal to expected file size.
Can someone shed some light on theis problem, please.