Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: GetFiles -certain files

I assume you need to remove the space from the path:
Dim networkPath As String = "\\asass\data01\asa\aqeqa "

The folder name is probably "aqeqa", not "aqeqa ".

Also the target path need to end with a backslash:
Dim networkPath As String = "\\asass\data01\asa\aqeqa\"


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,
and also few files other than archive.

And I want to download to this location,;
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
                ' 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("Successfully downloaded file.")
                    End If
                    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.