2

I'm using a PowerShell script and WinSCP to upload a file onto an SFTP site, Root\Users\SFTPSite and it's placing the directory onto the SFTP site that I'm uploading from. So instead of putting it on Root\Users\SFTPSite it's putting it into Root\Users\SFTPSite\Outbound. Not sure if it's a permissions issue that's preventing me from placing it in the SFTPSite directory or something to do with how the SFTP site was setup or something else because I'm using the same script for other sites without a problem. Here are the parameters I'm using

param (
    $localPath = "\\fileshare\ftp\ThirdParty\Outbound\",
    $remotePath = "/users/SFTPSite/"
)

And here is how I'm transferring,

$transferResult = $session.PutFiles($localPath, $remotePath, $False, $transferOptions)

Any help would be greatly appreciated. - Thanks.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

1 Answers1

1

Isn't it because you are copying the directory ?

Do you try to copy the content adding a * ?

 param (
     $localPath = "\\fileshare\ftp\ThirdParty\Outbound\*",
     $remotePath = "/users/SFTPSite/"
      )
JPBlanc
  • 70,406
  • 17
  • 130
  • 175