Questions tagged [winscp-net]

The WinSCP .NET assembly (winscpnet.dll) is a .NET wrapper around WinSCP's scripting interface that allows your code to connect to a remote machine and manipulate remote files over SFTP, FTP, WebDAV and SCP sessions from .NET languages, such as C#, VB.NET, and others, or from environments supporting .NET, such as PowerShell and SQL Server Integration Services (SSIS).

Filter by
Sorted by
Tagged with
1 vote
0 answers
16 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,746
1 vote
1 answer
31 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,746
-1 votes
0 answers
17 views

Including some subdirectories while excluding other subdirectories in a directory in winscp

Is it possible to do this in WinSCP? Root Trunk1 | | -------> branch 1 (*include*) -------> branch 2 (_exclude_) -------> branch 3 (_exclude_) -------> branch 4 (_exclude_) -------> ...
  • 884
1 vote
1 answer
36 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
38 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( ...
  • 150
0 votes
1 answer
73 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
98 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 ...
  • 11
1 vote
1 answer
87 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
39 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 ...
  • 13
1 vote
1 answer
67 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
229 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
149 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 @ { ...
  • 126
1 vote
2 answers
283 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 ...
  • 1,529
0 votes
1 answer
59 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
180 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 ...
  • 1,160
0 votes
1 answer
245 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 ...
  • 449
1 vote
1 answer
119 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
240 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
372 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
111 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
257 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) ...
  • 37
1 vote
1 answer
293 views

Download files from last 3 days using WinSCP .NET assembly in PowerShell

I have this script and I want to collect all file with extension *.did for the last 3 days but it fails with below error. I don't think that I use correctly the Get-ChildItem. Thanks for your help $...
  • 37
0 votes
0 answers
32 views

WinSCP SSH settings [duplicate]

I have a program section like this. However, I get an error on SshHostKeyFingerprint. I don't understand what is supposed to go in here. When I use the WinSCP program and enter the credentials, ...
  • 7,346
1 vote
1 answer
467 views

"The version of WinSCP.exe does not match version of this assembly" when using WinSCP .NET assembly in SSIS package

I am trying to move files through SFTP using WinSCP. The current version I'm using is working for all other SSIS packages. But when it comes to specific package I'm getting this error. Can you please ...
-1 votes
1 answer
78 views

WinSCP .net library - Protocol.Ftp - System.FormatException Invalid length for a Base-64 char array or string

I have SFTP working, just to trying to add Ftp to our existing program. Is SshHostKeyFingerprint recommended for Ftp protocol the same as with SFtp? If needed, how would I format this key? Does it ...
  • 16.8k
0 votes
1 answer
444 views

WinSCP.exe does not match version of this assembly

I tried to update to the latest version of WinSCP. We do have the .exe in our project. I made sure it was the correct version, and it has "Copy" Getting Error: Exception thrown: 'WinSCP....
  • 16.8k
1 vote
1 answer
142 views

How do I upload the last 3 files in a directory with WinSCP?

Trying to upload the last 3 files in a directory. I figured I can set the last 3 files and make them as an alias but I'm not sure how to do that.. Originally WinSCP was the transferring three specific ...
2 votes
1 answer
481 views

WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet

I am new working in a lab that sends data from a local computer to an HPC. I have been all day working around the following problem I am not familiar with it at all. 4/19/2022 3:21:28 PM ERROR: WinSCP....
0 votes
1 answer
291 views

WinSCP getting password from xml file

I have successfully created a syntax that uses the WinSCPnet.dll (.NET assembly). Also, a config.xml file has been created to provide the credentials and start the session. I do this successfully with ...
0 votes
0 answers
287 views

Trouble with WinSCP & SISS. Execute Process Task Error

I am having difficultly with grabbing data from our WinSCP site through our SSIS software. Below is the Process I currently have Executable: C:\Program Files (x86)\WinSCP\WinSCP.exe Arguments /script=...
user avatar
1 vote
1 answer
666 views

WinSCP Power shell script is generating error "The value supplied is not valid, or the property is read-only" while connecting to SFTP server

I my trying to connect to a client SFTP server from our Windows Server to pull the files. The connection works fine when trying from my Local machine both using WinSCP application and PowerShell ...
1 vote
1 answer
191 views

WinSCP .NET Assembly impersonation issue: The stub received bad data

I have an .NET console app using WinSCP assembly version 5.19.5. The app is under impersonation in order to access files on NAS so that I set ExecutableProcessUserName and ExecutableProcessPassword ...
2 votes
0 answers
101 views

Including WinSCP with PackageReference copies Winscp.exe in MY package

I have a problem with the WinSCP.exe file in my created NuGet package. I reference WinSCP in my project as follows: <PackageReference Include="WinSCP" version="5.17.10" /> ...
1 vote
1 answer
216 views

Change path before executing "SITE P_DEST" FTP command in WinSCP

Is it possible to change path in WinSCP? I know session.PutFile(fileStream, '/general/incoming/Test.zip') will write file at path mentioned. But when I try with command CommandExecutionResult result = ...
  • 2,067
1 vote
1 answer
337 views

How can I download all txt files that has been created in the last 60 seconds from my SFTP Server?

static void Main(string[] args) { var fileSystemWatcher = new FileSystemWatcher(@"filepath") { Filter = "*.txt", NotifyFilter = NotifyFilters.FileName, ...
  • 27
0 votes
1 answer
816 views

WinSCP .NET assembly does not recognize FTP link/URL in Session.PutFiles

Uploading some txt files from a local folder to a specific FTP address (I'm using this, ftp://ftpint/sales/to_system/) is one of my daily routines. I'm using ZappySys for automate this routine, but my ...
1 vote
1 answer
1k views

Upload set of files using WinSCP.Session in PowerShell

I'm trying to upload three specific files, and get feedback for all three transfers. With the code below I only get Upload of \xxxxxxxxxxxxxxxxxxx\Customerlocations.txt succeeded I understand it's ...
1 vote
1 answer
464 views

Showing SFTP directory structure with TreeView using WinSCP in C#

I'm trying to achieve the following, building a TreeView component showing all the directories and subdirectories of an SFTP folder using the WinSCP .NET assembly API. like this: Home ---->...
  • 23
1 vote
1 answer
977 views

Prevent WinSCP "Timeout detected" error in PowerShell script

I noticed on my upload script that when a file is too big => ~ 10 MB this creates the following error: Local directory \\customer_data\001952\info\ contains 1 file(s) to be uploaded. Exception ...
1 vote
1 answer
370 views

Do not transfer whole local folder to remote directory using WinSCP but only files in it

I made an PowerShell script that transfers .txt and .csv files from local folders to remote directories. I would like to exclude the subdirectories and transfer only the .txt and .csv files from my ...
-1 votes
1 answer
345 views

Compare local and remote files using WinSCP .NET assembly

I'm trying to implement some logic to compare file information between remote server and local server. I need to compare the file name between local folder and remote folder and download only the new ...
  • 21
1 vote
1 answer
250 views

Transferring only selected set of subfolders and not files in root folder using WinSCP

I have the following in a ps1 script and I am connecting over FTP using WinsCP to a Nitrado server with the goal of copying the folder called backups and the contents over to my pc. The issue I face ...
  • 77
0 votes
1 answer
62 views

WinSCP error while performing directory Sync

I've developed a .Net console application to run as a webjob under Azure App Service. This console app is using WinSCP to transfer files from App Service Filesystem to an on-prem FTP Server. The job ...
  • 85
-1 votes
2 answers
274 views

WinSCP fails to run as a WebJob on Azure App Service

I've developed a .Net console application to run as a webjob under Azure App Service. This console app is using WinSCP to transfer files from App Service Filesystem to an on-prem FTP Server. The ...
  • 85
0 votes
2 answers
415 views

How to append text to a log file with WinSCP/C#

I'm trying to add text to a text file in a FTP server, but it overwrites it instead of appending, how to solve this ? SessionOptions sessionOptions = new SessionOptions { Protocol = Protocol.Ftp, ...
2 votes
1 answer
193 views

Transfer files which contains only digits and not letters using WinSCP in C#?

I tried below with no success - string mask = "Report01|*[A-Z]" +"*.txt"; //This line fails to select files which contains only digits TransferOperationResult transferResult; ...
1 vote
1 answer
992 views

WinSCP .NET assembly fails with "The winscp.exe executable was not found" in Session.Open in C# Azure function

First I generated a simple console application to see if the generated by WinSCP works fine - and this was the case Now I try to write an Azure function using WinSCP - in the same way - the same ...
0 votes
1 answer
360 views

WinSCP.Net, folder is not copied from remote to local

I have been using WinSCP to download files, periodically, from a Unix server to Windows server and it has been working with no issues. I also check if remote file is older or already exists (don't ...
  • 2,008
1 vote
1 answer
544 views

Check if a file transferred successfully in WinSCP, when using the Session.PutFile function

I am trying to send some files to a remote FTP server, and I need to make sure the files actually make it there before I continue my code. Is there a way to check if the file transferred successfully ...
  • 384
2 votes
2 answers
450 views

PowerShell and WinSCP script to check if there are more than 4 files in a SFTP remote directory

With PowerShell language and WinSCP I'm trying to create a script that daily check an SFTP remote directory to see if there are more than 4 files into it. If there are less than 4 files it's okay but ...

1
2 3 4 5
7