Post a reply

Options
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)

Options

Topic review

martin

Re: TransferEventArgs.Transfers is null when using WinSCP.Session.PutFiles for folders.

The TransferOperationResult.Transfers includes only files. If you "upload" an empty folder, there are no files.

It's consistent with the case the folder is not empty. The collection will include files in the folder, but not the folder itself.
dotps1

Re: TransferEventArgs.Transfers is null when using WinSCP.Session.PutFiles for folders.

UPDATE: this only happens if the folder is empty.
dotps1

TransferEventArgs.Transfers is null when using WinSCP.Session.PutFiles for folders.

When i use the the WinSCP.Session.PutFiles() method to transfer a folder, the TransferEventArgs.Transfers property is null. It seems to work fine with a file.

$so = New-Item -TypeName WinSCP.SessionOptions
$so.HostName = 'locallhost'
$so.UserName = 'Guest'
$so.Protocol = 'Ftp'
 
$s = New-Item -TypeName WinSCP.Session
 
$s.Open($so)
 
$results = $s.PutFiles('C:\TempFolder', './')
 
PS C:\> $results
 
Transfers Failures IsSuccess
--------- -------- ---------
{}        {}            True
 

i would like to use the $results.FileName and $results.Destination for other things.

thanks.