I'm writing a program that allows my user to either enter some text in a textbox or select a file on his or her hard drive to upload. I'd like, however, not to have to save the uploaded file on my server's hard drive, since I'm only going to read the whole
thing into memory anyway. Is there a way I can do this? On another note, how can I bring up what would be in VB6 (and I think .net, though I haven't done anything with them in the newer language) an open common dialog box and put the filepath in a textbox?
I can't seem to find anything about this on MSDN... Thanks for your help, -Starwiz
That article will show you how to use the Upload control, this will give you an idea how to use the StreamReader instead of saving to the hard-drive:
StreamReader sr = new StreamReader(fileUp.PostedFile.InputStream);
string strFile = sr.ReadToEnd(); // This string holds the text file now
sr.Close();
sr=null;
starwiz
Member
185 Points
37 Posts
Upload a file directly to memory?
Jul 28, 2003 02:56 AM|LINK
pjmcb
Contributor
2234 Points
459 Posts
Re: Upload a file directly to memory?
Aug 01, 2003 09:11 PM|LINK
I never gave a damn about the meterman until I was the man who had to read the meter.
Sharbel_
Contributor
6027 Points
1198 Posts
Re: Upload a file directly to memory?
Aug 02, 2003 01:43 AM|LINK
pjmcb
Contributor
2234 Points
459 Posts
Re: Upload a file directly to memory?
Aug 02, 2003 02:33 AM|LINK
I never gave a damn about the meterman until I was the man who had to read the meter.
starwiz
Member
185 Points
37 Posts
Re: Upload a file directly to memory?
Aug 02, 2003 02:38 AM|LINK