GetFiles -certain files

Advertisement

sitizalekoh
Joined:
Posts:
1
Location:
Malaysia

GetFiles -certain files

Hi. I am new and beginner to this WinSCP, please do help me, thanks alot.
I have file in ftp, which are,
/qqqq/DsssArr/Archive
and also few files other than archive.

And I want to download to this location,;
\\asass\data01\asa\aqeqa\
I need to download all files except than Archive file.
So I've searched and found that to except to except file using filemask. And I do like this,
Dim networkPath As String = "\\asass\data01\asa\aqeqa "
            Dim myNetworkPath As String = String.Empty
            Using session As New Session
                session.Open(sessionOptions)
                ' Download files
                Dim transferOptions As New TransferOptions
                transferOptions.TransferMode = TransferMode.Binary
                transferOptions.FileMask = "*.txt | Archive"
                If System.IO.Directory.Exists(networkPath) Then
                    Dim transferResult As TransferOperationResult
                    transferResult =
                        session.GetFiles("/qqqq/DsssArr/*", networkPath, False, transferOptions)
                    If Not transferResult.IsSuccess Then
                        Console.WriteLine("Failed to download...")

                        For Each ex As SessionException In transferResult.Failures
                            Console.WriteLine(ex.ToString)
                        Next
                    Else
                        Console.WriteLine("Successfully downloaded file.")
                    End If
                Else
                    Console.WriteLine("{0} is not a valid file or directory.", networkPath)
                End If
            End Using
            Return 0
        Catch e As Exception
            Console.WriteLine("Error: {0}", e.ToString)
            Return 1
        End Try

But I got an error, which is,
Failed to download...
WinSCP.SessionRemoteException: Error creating folder '\\penntfps01\data01\SAP\Daily OH\%20'.
System Error. Code: 112.
There is not enough space on the disk
The thread 0x1328 has exited with code 259 (0x103).

I have no idea how to do. Please help me. Thanks a lot.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum