"Chris Holliday" <ch***@noSpamPlease-adventureology.com> wrote in message
news:#f*************@tk2msftngp13.phx.gbl...
I would like to provide an interface for users to upload a csv (or other
text file). I would like to read the contents of the CSV while it is
uploading (from the stream). Is this possible? It is no trouble to read it
once it is saved, but I was thinking I could possibly save a step.
For the archives:
This is easily handled by doing something like the following:
Dim str As Stream
str = MyFile.PostedFile.InputStream()
Dim myText As String
Dim sb As New System.Text.StringBuilder()
Dim sr As StreamReader = New StreamReader(str)
myText = sr.ReadLine()
In the above, MyFile is the file input from the webform.
Thanks,
C.