.NET assembly - Cannot transfer some *.pgp files

Advertisement

Marius
Joined:
Posts:
3

.NET assembly - Cannot transfer some *.pgp files

Hi Together,
I have create an script for transfering some pgp files to an sftp. The strange thing is, that it is working if I have an txt file, if I will transfer the pgp - no file will be uploaded.

This is the basic code I'm using

$session.Open($sessionOptions)
# *** Daten kopieren ***
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Ascii
$localfile = $file.Name

$transferResult = $session.PutFiles("C:\export\$localfile", "/in/", $False, $transferOptions)

I have tried it with transfermode: binary, ascii and automatic - no differences

I also make a:
Write-Error $tranferResult.check() -> Result:

"C:\NEWExport.ps1 : Exception of type 'Microsoft.PowerShell.Commands.WriteErrorException' was thrown.
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,NEWExport.ps1"

Can someone please help me

Thanks
Marius

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,542
Location:
Prague, Czechia

Re: .NET assembly - Cannot transfer some *.pgp files

Please attach a full session log file for both .txt and .pgp transfer (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,542
Location:
Prague, Czechia

Re: .NET assembly - Cannot transfer some *.pgp files

The log file seems to show a successful transfer. So what exactly is the problem? Do you mean that despite the transfer seemingly succeeded, you cannot see the uploaded file in the remote folder? If that's so, how exactly do you check that? If you upload the .pgp file in WinSCP GUI or using another SFTP client, can you see the uploaded file?

Reply with quote

Advertisement

You can post new topics in this forum