T
Tom
Anyone know how to post a file to the client using
WebClient?
My usage is posting it to the Web Server.
How do you tell the object to post to the client?
I copied the code from the Microsoft site for examples of
text file downloads using WebClient, but it only copies
to the Web Server. I've tried the 'DownloadFile'
function, obviously, as well.
.... (it reads just fine.)
string TheirAddress = "C:\\temp\\client.zip";
System.IO.Stream TheirStream = MyClient.OpenWrite
(TheirAddress);
byte [] buf = new byte[1024];
int len = 0;
//loop through the stream and put the output in the
textbox.
while((len = MyStream.Read(buf,0,buf.Length))!=0)
{
//textOutput.AppendText(NewLine+"\r\n");
TheirStream.Write(buf,0,len );
}
WebClient?
My usage is posting it to the Web Server.
How do you tell the object to post to the client?
I copied the code from the Microsoft site for examples of
text file downloads using WebClient, but it only copies
to the Web Server. I've tried the 'DownloadFile'
function, obviously, as well.
.... (it reads just fine.)
string TheirAddress = "C:\\temp\\client.zip";
System.IO.Stream TheirStream = MyClient.OpenWrite
(TheirAddress);
byte [] buf = new byte[1024];
int len = 0;
//loop through the stream and put the output in the
textbox.
while((len = MyStream.Read(buf,0,buf.Length))!=0)
{
//textOutput.AppendText(NewLine+"\r\n");
TheirStream.Write(buf,0,len );
}