What is the best way to read uploaded files from Request.Files, StreamReader or BinaryReader or BufferedStream?

I have a form where a user can upload multiple files. I am using MVC 2.0 and in my controller I need to call a webservice, which is a generic import interface that requires files to be passed as byte [].

.NET exposes Request.Files as an HttpFileCollectionBase, and I access the file descriptor using HttpPostedFile or HttpPostedFileBase, which exposes the Stream member.

What's the best way to read bytes from a stream?

BinaryReader? StreamReader? BufferedStream?

+2


a source to share


1 answer


I would go with System.IO.Stream

.



0


a source







All Articles