Upload a file and stream it

  • Thread starter Thread starter blarfoc
  • Start date Start date
B

blarfoc

Hello, I need to do the following
1) give a click button on my aspx page where the user can find a file
on the hard drive
2) in my code read that file like a stream and then display it back to
the user
3) display that back to the user in a datagrid.

Can you tell me how to do this?

Woudl it be easier to replace 1) with this new 1)
1) allow a user to drag a file on to my aspx page
2) same as above
3) same as above

thank you
 
I would think you could just put a Web.UI.HtmlControls.HtmlInputFile into
your form, and then when the page posts back, check the Web.HttpPostedFile
collection:

Request.Files(n)

Each HttpPostedFile object has an InputStream property. If you find a file
in the collection, do whatever voodoo you want to do with the file data &
the datagrid.
 
Back
Top