Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - juangcxt

Pages: [1]
1
SFTP / Re: Howto filter Files with specific caracters in filenames?
« on: December 20, 2017, 03:02:32 PM »
I get the remote directory list and then use a method like this to determine whether or not the file name matches my filter (e.g. "*.pdf").

                string handle = sftp.OpenDir(remoteDirectory);
                if (handle != null)
                {
                    using (SFtpDir files = sftp.ReadDir(handle))
                    {
                        if (files != null)
                        {
                            for (int counter = 0; counter < files.NumFilesAndDirs; counter++)
                            {
                                using (SFtpFile file = files.GetFileObject(counter))
                                {
                                    if (!file.IsDirectory)
                                    {
                                        if(FitsMask(file.Filename, "*.pdf")) fileList.Add(file.Filename);
                                    }
                                }
                            }
                        }
                    }


        private bool FitsMask(string fileName, string fileMask)
        {
            Regex mask = new Regex(
                '^' +
                fileMask
                    .Replace(".", "[.]")
                    .Replace("*", ".*")
                    .Replace("?", ".")
                + '$',
                RegexOptions.IgnoreCase);
            return mask.IsMatch(fileName);
        }

2
SFTP / Message Not Extractable
« on: December 13, 2017, 10:44:28 AM »
I am using the 9.5.0.68 version of the SFTP .Net library.  I can connect to our partner's SFTP server, but when I try to download, I get a "Message Not Extractable" error (see http://www-01.ibm.com/support/docview.wss?uid=swg21699536).

I have attached a copy of the error and session log to this ticket.

Has anyone else seen this error?

Is there a fix or workaround?

NOTE:  I have contact our partner and they have assured me that they are on the latest patches for their server.

Pages: [1]