How to read fileupload into a string

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I put a fileupload in my web application to let user upload a text file.
I want to use a string variable to receive the file which user upload.
I do the steps below.

How can I read the content of the file form fileupload ?
 
The HttpRequest.Files Collection is a Collection of HttpPostedFile classes.
The HttpPostedFile class represents a stream, which is exposed via the
InputStream property. Use a StreamReader class to read the stream into a
string.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
Back
Top