Re: Retrieve a list of files from a remote server? - WeOnlyDo Discussion board

Re: Retrieve a list of files from a remote server? (General questions)

by Kamal, Friday, January 14, 2005, 17:42 (7251 days ago) @ wodSupport

thanks alot of your help.

However, Now, I would like to be able to convert the files retrieved to a Stream, How can I do that??

the code i'm using looks something like this:
-----------------------------------
sftp.GetFile(remoteDir + fileNames.GetByIndex(i)); //RemoteFile
StreamReader sr = new StreamReader(); //the changes should be here but what and how?

NewMsgStream = new MemoryStream();
StreamCopy(NewMsgStream, sr.BaseStream);
sr.BaseStream.Close();
fileNames.Remove(i);
sftp.DeleteFile();
------------------------------------

Note: I'm trying to convert it into a stream as I'm not interested into putting it somewhere locally. instead passing it to some other server and/or web service to process the Stream!)

Any suggestions please?


Complete thread: