What is the best way to read the uploaded files from Request.Files, StreamReader or BinaryReader or
Posted
by ramesh.nagul
on Stack Overflow
See other posts from Stack Overflow
or by ramesh.nagul
Published on 2010-04-29T17:22:00Z
Indexed on
2010/04/29
17:27 UTC
Read the original article
Hit count: 403
I have a form where the user can upload multiple files. I am using MVC 2.0 and in my controller I need to call a webservice that is a common import interface requires the files to passed in as byte[].
.NET exposes Request.Files as a HttpFileCollectionBase and I access the filehandle using HttpPostedFile or HttpPostedFileBase that provides access to the Stream member.
What is the best way for me to read the bytes from the stream?
BinaryReader? StreamReader? BufferedStream?
© Stack Overflow or respective owner