352 questions
1
vote
1
answer
145
views
How can I copy a single file whose name includes wildcard characters without listing the entire directory?
I'm using the WinSCP C# library. How can I copy a single file whose name includes wildcard characters (e.g., [Hospital1]_0001.txt) without WinSCP listing or scanning the entire directory?
session....
4
votes
1
answer
82
views
WinSCP PowerShell script with mask downloads files but creates empty folders
I am using a PowerShell script using the module WinSCP to download files from a SFTP server.
I am using a file mask so I only download files matching *.zip which have been added today. The SFTP folder ...
1
vote
1
answer
119
views
Can't exclude folder from synchronization with WinSCP .NET Assembly in PowerShell
The task is very simple but I can't implement it.
Need to exclude the system folder from the data that is synchronized to the remote backup server
My script
param (
$localPath = "E:\path"...
0
votes
1
answer
209
views
WinSCP .NET assembly error on SFTP connection "The client-to-server cipher ChaCha20-Poly1305 was not verified!"
I am using WinSCP .NET assembly to connect with one SFTP and getting error on Session.Open
The client-to-server cipher ChaCha20-Poly1305 was not verified!
Same connection is working when I am using ...
1
vote
1
answer
173
views
Creating file on remote directory using MemoryStream, WinSCP and PowerShell
I have read on WinSCP's site that you can create a file on the remote FTP server using the method Session.PutFile and using a MemoryStream to create the object on the remote directory.
The syntax ...
0
votes
1
answer
117
views
PowerShell WinSCP .NET Assembly GetFiles – "Timeout waiting for WinSCP to respond"
I'm having an odd issue following the $session.GetFiles command on the documentation page itself of GetFiles for .NET Assembly on Powershell.
When I take away the ClientFolder in the source directory (...
0
votes
2
answers
482
views
Proxy error: Unable to parse auth header from HTTP proxy: authentication type 'NTLM' not supported"
I am using a batch script to download files from an SFTP server over the Internet. The script is running on a VM which is behind a corporate proxy.
When I am logged in to the SFTP server via WinSCP, ...
0
votes
0
answers
63
views
To know PowerShell Script to compare timestamp of two directories of WinScp
I am new to PowerShell scripting and we have a problem statement to compare timestamp of files from two directories of WinScp. We know that winscp.net assembly support PowerShell script hence would ...
1
vote
1
answer
145
views
Duplicating files from one directory to another on SFTP server using WinSCP and C#
I'm trying to duplicate files from one directory to another using WinSCP while using Session.DuplicateFile. It is duplicating file but instead of provided path, it is saving file on the root directory....
0
votes
1
answer
305
views
WinSCP .NET assembly directory list timeout
When there are many files in the remote directory often have session timeout problem, what's the default session time and if increase will be any side effects?
var allFiles = session....
1
vote
3
answers
560
views
BizTalk Server 2020 - Temp Files not getting cleaned within InProcess User Context
We are using BizTalk Server 2020 with SFTP Adapter (WinSCP Version 5.21.5).
Multiple Receive Locations and other Artefacts are running under this user.
Unfortunately our Admin contacted me that the ...
1
vote
2
answers
436
views
Check SFTP connection using WinSCP .NET assembly in C# while loop
I want to display the live connection status in my console application. The problem is that I'm stuck in a loop and I have no idea how to check correctly the connection status while I'm looping. When ...
1
vote
0
answers
249
views
Send all *.csv files in directory to SFTP Server using Script Task in SSIS c#
https://winscp.net/eng/docs/library_ssis
I am trying to follow this script to eventually get all csv files from a directory on our local network uploaded to an SFTP server. I don't get any errors when ...
2
votes
1
answer
3k
views
How to check the encryption algorithm being used in the SFTP session through WinSCP?
I am using WinSCPnet, Version=5.19.0 for file transfer using SFTP. The vendor where I was transferring file has deprecated a couple of ciphers. I want to check which cipher or encryption algorithm is ...
1
vote
1
answer
209
views
WinSCP PowerShell script to download most recent file but only for files matching a partial name
I'm new to this WinSCP scripting, however, I'm trying to find a script that would download the most recent file, but it only account for files that match a partial name criteria.
I found this script, ...
1
vote
1
answer
369
views
The property 'PreserveTimestamp' cannot be found on this object when using WinSCP .NET assembly
I'm getting this error:
The property 'PreserveTimestamp' cannot be found on this object. Verify that the property exists and can be set.
At path\OSBU_Broker_Extract02.ps1:14
char:3
+ $session....
1
vote
1
answer
333
views
Setting Filename modification Replace option in WinSCP .NET TransferSettings
In the WinSCP application there is a check box in the Transfer settings dialog to indicate if certain filename characters should be replaced when a file is transferred.
It's the Replace check box in ...
1
vote
1
answer
258
views
Azure Automation is crashing when connecting with WinSCP
Currently having an issue where I am struggling to get the WinSCP PowerShell module to work as expected within an Azure Automation Runbook. Installed via the gallery but the cmdlets were not showing ...
2
votes
1
answer
2k
views
Why do I need to use SshHostKeyFingerprint in WinSCP .NET assembly, when WinSCP GUI does not require such option?
It is the first time I am using a WinSCP .NET client for uploading files from remote Linux PC. If I run following code without defining SshHostKeyFingerprint I get Error:
SessionOptions.Protocol is ...
1
vote
1
answer
618
views
SSIS Script task with WinSCP fails on server but works locally even though the WinSCP assembly is registered in GAC
All of the errors below are returned by running an SSIS Package that is deployed to SSISDB on a server (SQL Server 14.0.3445.2) - it all runs without error when running in Visual Studio on my own ...
1
vote
1
answer
238
views
Check if WinSCP downloaded files for every day between two dates
I have this script to collect logs file between two dates. Normally I have logs created for everyday on remote machine but is there any possibility to show what file exist or not?
For example If I try ...
0
votes
1
answer
708
views
Get info on files transferred with WinSCP in PowerShell
I use this script to get file between two dates via WinSCP. How is it possible to print in the console which files were found on the remote computer and which were not because at the moment I am not ...
1
vote
2
answers
352
views
WinSCP.exe missing in .NET Core AWS Lambda Function
I have developed a .NET Core 6.0 using WinSCP 6.1.0 NuGet package. Locally, from my own PC, I can access a SFTP server, obtaining connection and being able to PUT files.
When I deploy my app as a AWS ...
0
votes
1
answer
948
views
SFTP using WinSCP .NET timeouts in C# when connecting to port 2222
I can connect to SFTP using the FileZilla in a machine, in the same machine when I try to connect via C# code it gives error as
Network error: Connection to "fs2.comparethemarket.com" timed ...
0
votes
1
answer
533
views
BizTalk Sftp Receive Location cant get Attributes ( Event Log )
We are using BizTalk Server 2020 with a Receive Location ( Sftp Adapter - Winscp ), which downloads files from a Sftp Server.
The Url we poll the files from is: sftp://://* ( so we poll all the files ...
0
votes
1
answer
195
views
Change WinSCP PowerShell script to synchronize CSV files over 90 days old only
I would like to change this portion of a PowerShell script which uses WinSCP to connect to an SFTP Server.
I would like to modify this script so that in addition to downloading and then deleting .csv ...
1
vote
1
answer
215
views
How can I change this WinSCP script to only to download .csv files and no other files?
I would like to change this PowerShell WinSCP script which is connecting to an SFTP Server, to only download .csv files.
What part of the following portion of the script would I need to change?
# ...
0
votes
1
answer
2k
views
Configure WinSCP PowerShell script to also include a private key
I would like to add a private key to the code found from the WinSCP website.
Based on https://winscp.net/eng/docs/library_example_delete_after_successful_download
# Setup session options
$...
3
votes
1
answer
205
views
C# save WinSCP stream to Azure Blob Storage Error: Offsets with value of non-zero are not supported
I am trying to save a file downloaded from an SFTP site using the WinSCP .NET library, and then save it Azure Blob storage. I don't want to use CloudBlobContainer as it is deprecated. I keep getting ...
1
vote
1
answer
583
views
Sharing WinSCP .NET Session across multiple C# methods
I've written a program in C# using WinSCP .NET which recursively searches through an SFTP site looking for a specific subfolder pattern, and then recursively enumerates the contents of those ...
1
vote
0
answers
59
views
How can I force an exception or error in WinSCP NET assembly for testing purposes?
I am using the WinSCP NET assembly to synchronize directories. I have added
session.QueryReceived += (sender, e) =>
{
//Write line to Error Log
...
1
vote
1
answer
505
views
Setting WinSCP ResumeSupport.State is ignored
I an trying to perform a synchronization in a C# script in SSIS. I would like to turn off ResumeSupport.State. I am using the code below, but I still get an error message of:
Transfer was successful, ...
1
vote
1
answer
277
views
How can I show files being downloaded in WinSCP .NET assembly from PowerShell
I have a script that downloads some recordings from an FTP server and the downloads are saved in a folder inside a local path on my computer.
I have been able to trigger a message when all the ...
1
vote
1
answer
960
views
WinSCP Session.EnumerateRemoteFiles does not work with mask with time constraint
I'm trying to get the files from the SFTP server. The goal is, to get files newer than 24 hours.
This mask works. The count returns 9018.
var filesCount1 =
session.EnumerateRemoteFiles(
...
0
votes
1
answer
2k
views
Downloading files from WinSCP using Python script
How to download multiple files from different location folders from WinSCP server to the local folder using python script?
Is there any python module available which I can import and use that to ...
1
vote
1
answer
241
views
SFTP upload of files that were created since the last run
I am very new to PowerShell and I am in the process of writing a script that performs an SFTP file transfer via WinSCP. I will then be creating a Task on Windows Task Scheduler to run this script ...
1
vote
1
answer
657
views
Delete downloaded remote file with WinSCP script
I have a PowerShell script that is working great to grab some files from a remote SFTP. But I can not get the code to delete the files after download. Here is what I have.
$session.Open($...
1
vote
1
answer
244
views
Use URL instead of hostname with WinSCP .NET assembly
I am using WinSCP to upload a file to an FTP host. But I only had ftp://xxx.xx.xx.xx path, not hostname like ftp.example.com.
Can I use ftp://xxx.xx.xx.xx for hostname?
My code is based on
...
1
vote
1
answer
761
views
Upload to S3 with WinSCP .NET PowerShell script fails with "Specify target bucket"
I have a PowerShell script to put a local file up to an S3 bucket. However, it is failing:
# Set up session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [...
1
vote
1
answer
704
views
Create WinSCP SessionOptions using ASP Session variable in way it can be reused between multiple methods
I am facing issue while creating WinSCP Session[Options] variable in C# ASP page.
I have login page where I am defining session variables.
namespace HLR_Handling
{
public partial class Login : ...
1
vote
2
answers
326
views
Run script on remote SUSE Linux with root privilege using WinSCP .NET assembly
I'm trying to execute sh script from Windows on Remote SUSE Linux using WinSCP .NET assembly.
I've created a session as follow:
$sessionOptions = New-Object WinSCP.SessionOptions -Property @
{
...
1
vote
2
answers
601
views
Download one day old files from all FTP directories to one local directory using WinSCP .NET assembly
Goal: I'm trying to get all files that are 1 day old or newer. The remote directory has a lot of directories as well as files on the root directory.
I need to look in each directory, get any files 1 ...
0
votes
1
answer
208
views
How to achieve Recycle Bin functionality in WinSCP .NET assembly
I have an application where I'm performing Directory Synchronization between Local and Remote directories using WinSCP .NET assembly.
Now I want to keep overwritten remote files in the Remote recycle ...
1
vote
1
answer
1k
views
Why is SFTP fingerprint from FileZilla not accepted by WinSCP .NET assembly in C#?
I'm setting up to put files using SFTP to a client's server. I have an SFTP server to test and developed a client using WinSCP in C# VS2022 on Windows Server 2019. I initially logged on to the test ...
0
votes
1
answer
1k
views
In C# how to upload file on FTPS server Encryption Type 'Required Explicit FTP over TLS'
I need the expert help. I have written the C# console base application. In which I have to upload the zip file to FTPS server. Every time I am getting the connection refuse error. But when I connect ...
1
vote
1
answer
218
views
Build in Jenkins succeeds even when WinSCP PowerShell transfer script fails
I sometimes noticed that some Jenkins builds have an error in their output without ending with an error (for instance, with an exit 1) but with a success.
This comes from the WinSCP $transferResult....
1
vote
1
answer
746
views
WinSCP Session.SynchronizeDirectories() throws error if one or more files is being used by another process
I have a local folder D:\test that I want to sync with a remote server folder /home/test. The below code works fine in a normal case. But the problem was when I worked on one or more files from that ...
1
vote
1
answer
1k
views
Why can't I authenticate with SshHostKeyFingerprint instead of Password using WinSCP .NET assembly?
This script is an example from here: https://winscp.net/eng/docs/library_powershell
I have just edited paths and session options.
I can successfully connect with to the sftp server with the private ...
0
votes
1
answer
327
views
FileTransferProgress refresh every x seconds WinSCP
Is there a way to refresh the download/upload progress of a SFTP transfer in WinSCP? I know by default is updated every second, but for smaller files, it would be great to refresh every 100ms or so.
I ...
1
vote
1
answer
860
views
Create destination folder on FTP server, if it does not exist yet, using WinSCP in PowerShell
I have this script and I want to transfer archive witch script created previous to the server. But on the server I want to check and create if the target folder with name of the machine ($inputID) ...