Hi Omar,
Most likely, you didn’t close the stream object before calling GetCurrentFolder().
GetDownloadStream() issues a “receive file” command to the server and lets you control the download stream. The FTP client remains in a “ReceivingFile” state until the stream is closed.
Source:
http://doc.xceedsoft.com/products/XceedFileSystem/#topic1973.html
You could change your code to the following:
Stream destinationStream = new MemoryStream();
// Get a download stream for the current file
using( Stream stream = http://ftp.GetDownloadStream( files[i].Name ) )
{
byte[] buffer = new byte[ 32 * 1024 ];
int read;
// While there is data to download
while( ( read = stream.Read( buffer, 0, buffer.Length ) ) > 0 )
{
// Write the downloaded data to our destination stream
destinationStream.Write( buffer, 0, read );
}
}
// Get the current folder
string d = http://ftp.GetCurrentFolder();
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Fawzi [Xceed] (had 296 views)