Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

dimic

I see, thanks!
martin

dimic wrote:

But I still have a question regarding skipped boolean parameter. As far as I understood from documentation, the default value for skipped parameter should be False, but the command
$session.GetFiles(($remotePath + $i.Name ), $localPath,$transferOptions).Check()
anyway removes source files from FTP

Now you are passing $transferOptions to remove parameter. As it is non-empty object, I expect again that PowerShell interprets it as True.
dimic

Aha! Thanks Martin!
I'm new in Powershell, stupid mistake.

But I still have a question regarding skipped boolean parameter. As far as I understood from documentation, the default value for skipped parameter should be False, but the command
$session.GetFiles(($remotePath + $i.Name ), $localPath,$transferOptions).Check()
anyway removes source files from FTP
martin

Re: Winscp 5.1.5 .Net library removes files after downloading

I do not know PowerShell enough to tell, what it exactly does when you pass a "false" to boolean parameter. But obviously it interprets it a as a true. You should use $False instead.

For example see https://winscp.net/eng/docs/library_powershell#example
dimic

Seems that this happens not only for folders, but also for files
In the debug log I always see something like:
<group name="get -delete -nopermissions -preservetime -transfer=&quot;binary&quot; -- &quot;/PA/dimic/temp2/1031/BM_1031_1300_tr.mp4&quot; &quot;d:\temp\mp4\*&quot;" start="2013-07-10T15:08:43.665Z">
<download>
<filename value="/PA/dimic/temp2/1031/BM_1031_1300_tr.mp4" />
<destination value="d:\temp\mp4\BM_1031_1300_tr.mp4" />
<result success="true" />
</download>
<rm>
<filename value="/PA/dimic/temp2/1031/BM_1031_1300_tr.mp4" />
<result success="true" />
</rm>
</group>
dimic

Winscp 5.1.5 .Net library removes files after downloading

Hi!
I use Powershell with WinSP library ( 5.1.5).
I discovered one strange thing - method GetFiles for some reasonm removes source files
I've tried to use 2 variants of the command:
$session.GetFiles(($remotePath + $i.Name ), $localPath,"false",$transferOptions).Check()
$session.GetFiles(($remotePath + $i.Name ), $localPath,$transferOptions).Check()
These commands downloads all files from a _folder_ on a FTP server.

Files were downloaded and after that the source folder become removed.