I have an asp.net MVC application that takes in uploaded NMEA track files from small GPS loggers. In some cases, the loggers will inject null (0x0) values into the track file text. Is there a way to strip out these 0x0 characters from the HttpPostedFile's InputStream before saving the file to the server's file system for processing? As it is, I can only get to the first null character and that's all of the file that gets saved on the server.
Thanks, Matthew
InputStream is binary and shouldn't care about zeros. So, the problem is with the data conversion to text - but you didn't show the code that you use to convert.
You may manually skip/replaces zeros:
and now you got stream without zeros (of course you can read in blocks, etc, if you want to).