I'm working on an upload control for ASP.NET, and I need to work with Request.GetBufferlessInputStream()
This returns the raw unprocessed request stream. Is there a built in way to parse the content of this stream, stripping out headers such as the example I've copied below.
If not what is the best approach to parsing the file?
-----------------------------13166267887793
Content-Disposition: form-data; name="uploadFile"; filename="ABigFile.txt"
Content-Type: text/plain
The solution came from inspecting how it's done in System.Web, and adapting to my needs. The core functionality is found in an internal class called HttpMultipartContentTemplateParser. The system for processing the input stream is written up here:
http://blog.appsoftware.com/2014/03/aspnet-file-uploader-with-signalr.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With