Re: transfer Stream to a remote server (Stream not (General questions)
The PutFile method is trying to seek the stream passed to it. However, The stream produced by the xml assembler which is not necessarily seekable!!
so Is there anyway we can stop PutFile from seeking the Stream?
So what've done is creating a VirtualStream and pass it the method, the snapshot of the code is as follows:
-----------------------------------------------
s Stream = new Stream(); (s is assigned some values from an xml msg.)
------------------------------------------------
VirtualStream rs = new VirtualStream();
XmlTextReader XmlDataRdr = new XmlTextReader(s);
XmlTextWriter XmlDataWrtr = new XmlTextWriter(rs,null);
XmlDataWrtr.WriteNode(XmlDataRdr, false);
XmlDataWrtr.Flush();
ResponseStream.Seek(0,SeekOrigin.Begin);
-------------------------------------------------------
I initially tried to use seak for the Stream but it wouldn't work. However, when using the virtual stream, it worked perefectly.
One question though, the server is passing a multiple streams, i.e. many file, lets say 100 to 1000 files. the streams keeps firing the method which includes the following:
SFTP sftp = new SFTP();
sftp...properties assigned here such sftp.RemotePath etc..
.....
sftp.Connect();
sftp.PutFile(stream, RemotePath);
sftp.Disconnect();
Is this the correct way of going about sending multiple files/Streams? or it seems like repeating the process of each single file/stream?
is there any other way of sending multiple files without having to initialise and connect over and over again?!
does the above process affect the performance?
Thank you and hope to hear from you very soon.
Complete thread:
- transfer Stream to a remote server (Stream not see - Kamal, 2005-01-06, 18:37
- Re: transfer Stream to a remote server (Stream not - wodSupport, 2005-01-06, 21:07
- Re: transfer Stream to a remote server (Stream not - wodSupport, 2005-01-07, 01:17
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-07, 16:56
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-07, 17:03
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-10, 17:21
- Re: transfer Stream to a remote server (Stream not - wodSupport, 2005-01-10, 23:41
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-11, 12:11
- Re: transfer Stream to a remote server (Stream not - wodSupport, 2005-01-11, 13:13
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-11, 12:11
- Re: transfer Stream to a remote server (Stream not - wodSupport, 2005-01-10, 23:41
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-10, 17:21
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-07, 17:03
- Re: transfer Stream to a remote server (Stream not - Kamal, 2005-01-07, 16:56
- Re: transfer Stream to a remote server (Stream not - wodSupport, 2005-01-07, 01:17
- Re: transfer Stream to a remote server (Stream not - wodSupport, 2005-01-06, 21:07