Problems to get MemoryStream using FtpClient.Download(string remotePath- Stream destinationStream)-Method

Dear Aspose-Team,

we’re currently using the class FtpClient and aspecialy the Method Download (see subject). If we try to execute the following code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Aspose.Network.Ftp;
using System.IO;

namespace FtpTestApplication
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}

    <span style="color:blue;">private</span> <span style="color:blue;">void</span> buttGetFTP_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)
    {
        <span style="color:#2b91af;">FtpClient</span> ftpClient;
        ftpClient = <span style="color:blue;">new</span> <span style="color:#2b91af;">FtpClient</span>(<span style="color:#a31515;">"kutest-ftp"</span>, 80, <span style="color:#a31515;">"TestLogin"</span>, <span style="color:#a31515;">"TestPassword"</span>);
        ftpClient.TransferType = <span style="color:#2b91af;">TransferType</span>.Binary;
        ftpClient.Connect(<span style="color:blue;">true</span>);
        <span style="color:#2b91af;">ListItem</span>[] Lst;
        Lst = ftpClient.ListDirectoryDetails(<span style="color:#a31515;">"TestFolder"</span>);

        <span style="color:blue;">string</span>[] FileList = <span style="color:blue;">new</span> <span style="color:blue;">string</span>[Lst.Count()];
        <span style="color:blue;">int</span> i = 0;
        <span style="color:blue;">foreach</span> (<span style="color:#2b91af;">ListItem</span> itm <span style="color:blue;">in</span> Lst)
        {
            FileList[i++] = itm.Name;

        }
        ftpClient.ChangeDirectory(<span style="color: rgb(163, 21, 21);">"</span><span style="color:#a31515;">TestFolder</span><span style="color:#a31515;">"</span>);

        <span style="color:#2b91af;">Stream</span> stmReader = <span style="color:blue;">new</span> <span style="color:#2b91af;">MemoryStream</span>();
        ftpClient.Download(FileList[0], stmReader);
    }
}

}

we receice the exception by trying to use the stream:
“Cannot access a closed Stream.”.

So, what is the right way to use this method and to use the given Stream?

Thanks for answers!

Greetings from Germany,
Stephan

Hi Stephan,

Thank you for inquiry.

I have reproduced the issue and logged it in our bug tracking system (ID: 25679). We will inform you when it gets fixed. Sorry for the inconvenience.

Hello Aspose-Team,

is this issue already solved? Because we need a fast solution…

Greetings,
Stephan

Hi Stephan,

The issue is resolved and will be included in v6.4, which will be published by the end of this month.

The issues you have found earlier (filed as 25679) have been fixed in [this update](http://www.aspose.com/community/files/51/.net-components/aspose.network-for-.net/entry299819.aspx).

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Thanks a lot. Today, we will test this release as well as the fixed stream-bug on ftp-download.