WinSCP | WinSCP PowerShell Wrapper Module | FTP library
kandi X-RAY | WinSCP Summary
kandi X-RAY | WinSCP Summary
WinSCP PowerShell Wrapper Module
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WinSCP
WinSCP Key Features
WinSCP Examples and Code Snippets
Community Discussions
Trending Discussions on WinSCP
QUESTION
I have a problem with trying to send files using a PHP FTP function.
I am attempting to send files (PDFs) from a webserver (UNIX) to a Windows server in an office using a PHP function running on the webserver. FTP has been installed on the Windows server.
The function connects to the office server and logs in ok. However, as soon as the function attempts to do anything (eg list the content of the office server directory) I get an error (such as... ftp_nlist(): php_connect_nonb() failed: Operation now in progress (115)
). The destination server logs an error: [Administration Server] Couldn't bind on 192.168.1.1:14148. Reason: EADDRINUSE - Local address in use. Retrying in 1 seconds
. I have tried looking these errors up but have ben unable to find anything that helps me.
The connection needs to be passive and from other answers in SO I believe that it is important to stop the passive mode using the wrong IP address. So that is in there now too (ftp_set_option($ftp_conn, FTP_USEPASVADDRESS, false)
) but I still get the same error.
I get the same problem when using an SSL or non-SSL connection.
I have managed to get a response to ftp_systype which tells me "UNIX".
Other people have talked on SO about intermittent problems that cause this error (eg "php_connect_nonb() failed: Operation now in progress (115)" happens intermittently) but for me it is a constant error. I have checked and the FTP server is set to return the external IP address when passive mode is established. I also understand that there were some issues in older versions of PHP. I have PHP v7.4 on the webserver.
I can connect (and copy files) without problems using Filezilla and WinSCP, just not when using the PHP function.
The PHP function contains:
...ANSWER
Answered 2022-Apr-04 at 06:19Make sure the hosting of your webserver allows outgoing FTP data connections.
FTP data connections (in the passive mode) need separate port range opened in the firewall, not just the control connection port 21.
See my article on FTP connection modes to details.
QUESTION
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
for the Session
object.
ANSWER
Answered 2022-Mar-18 at 11:29It seems that you need to specify the domain:
Stub received bad data?
QUESTION
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 script. But I have to add proxy setting while I am trying to connect from the server which is not the case in Local connection.
While in the server I am able to connect from WinSCP application by enabling proxy setting but fails when I am trying to connect using PowerShell script. I got the custom generated PowerShell script from WinSCP connection. Below is the code snippet and corresponding error message.
...ANSWER
Answered 2022-Feb-28 at 09:26The most probable explanation is that the value of SessionOptions.SshHostKeyFingerprint
is invalid, no other property in your code is validated.
As your fingerprint format seems correct, but as it is a "modern" ssh-ed25519
key, I assume that you have an old version of WinSCP .NET assembly that does not accept this key. You have probably used newer version of WinSCP (the GUI) to obtain this key, but your version of .NET assembly does not accept it. Make sure you use the latest version of the assembly.
QUESTION
How can I disable the option not to open VS
and Code
tabs every time I open a file in VS Code?
It only occur when I open from WinSCP a file on a remote server.
...ANSWER
Answered 2022-Feb-24 at 17:10Check your WinSCP external editor preferences.
The command should be:
QUESTION
As part of a larger task I want to move some files, work on them and return the new files to the sftp server. Due to restrictions laid upon me I am only able to use Python 3.4, which excludes me from any nice and fancy modules like Paramiko and pysftp.
Connection to the server fails, according to the stdout pipe the hostkey is incorrect. The returned "incorrect" key is not identical to the one that was passed to the function. It has an additional, leading backslash and is cut short. The originally passed key is "ssh-XXXXXXX 256 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
. The "incorrect" key is "\ssh-XXXXXXX"
.
The presumption is, that subprocess.Popen
mangles the string in a way.
- hostkey, passphrase, and privatekey are all necessary
- the hostkey has been generated directly by the server and matches the fingerprint returned by the stdout pipe
- the connection works when done in a windows shell, but implementation in python is desired.
- the connection works when accepting any given Key through usage of
*
, but that would obviously be insecure, therefore not viable.
Code is as follows:
...ANSWER
Answered 2022-Feb-23 at 07:11I believe it's Windows Python issue.
Just format the commandline yourself, instead of having Popen doing (incorrectly) it for you:
QUESTION
I use Visual Studio Code and WinSCP. When I open .scss file via WinSCP the file is opened automatically by VSC – It's ok. There is an extension Live Sass Compiler to I could compile .scss into .css file. The problem is that .css file is created in temporary folder with random number so I always must upload the file manually by drag the file from the folder to FTP client.
Is it there any solution to upload the .css file automatically on save from the temporary folder? Thank you in advance for a help.
...ANSWER
Answered 2022-Feb-10 at 13:38- Download the files to a local folder.
- Have WinSCP monitor the folder and automatically upload any modifications (including new files).
- Edit the files locally (and have WinSCP upload the changes, including the generated files).
For your literal question, there's WinSCP feature request.
QUESTION
I have an issue while connecting to a FTPS server with TLS/SSL Implicit encryption via PROXY.
I am following the custom Apache FTPS Client (commons-net-3.8.0) solution provided from Java FTPS client through HTTP proxy
My server connection is working, but unable to list or file transfer, getting below error:
425 Can't open data connection for transfer of ""
Data connection / File transfer is working fine from Windows WinSCP and Linux LFTP.
WinSCP Log:
...ANSWER
Answered 2022-Feb-07 at 15:21I do not know your network/proxy setup, so I cannot really explain the behaviour of FTPClient
. Your server seems to return IP address of the proxy in the PASV
response. The default NAT resolver of FTPClient
decides that the address is wrong (is it a local network host address?) and choses to use original FTP server's address instead.
While WinSCP does not do that and connects to the IP that the server returned.
To avoid the NAT resolver from messing with the address, use FTPClient.setPassiveNatWorkaround
(though that's deprecated):
QUESTION
I need to automate the upload of some files from client PCs to a central server. We're building central statistics for an online gaming community, processing game replay files.
- target is my own small VPS server running ubuntu
- upload file size 2-3MB
- 20-40 different clients running windows spread around the globe
- I expect ~6GB of wanted data to be uploaded over the course of 7 weeks (a season in our game) and 5-10x that amount of "unwanted" data.
The files are processed on the server, and then they're not required anymore, and ought to be deleted to not run out of disk space eventually. I also only need some of the files, but due to the files requiring very complex processing including decryption, so i can only determine that after the server processed it.
My initial idea was to use a scriptable client such as WinSCP, and use some Windows scheduler entry to automate it. WinSCP documentation looks very nice. I am a bit hesitant because I see the following problems:
- after deletion on the server, how to prevent re-upload ?
- ease of setup to technical novices
- reliability of the solution
I was thinking maybe someone has done the same before and can give some advice.
...ANSWER
Answered 2022-Jan-27 at 06:32There's article on WinSCP site that deals with all this:
How do I transfer new/modified files only?
For advanced logic, like yours, it uses PowerShell script with use of WinSCP .NET assembly.
Particularly, there is a section that you will be interested in: Remembering the last timestamp – It shows how to remember the timestamp of the last uploaded file, so that the next time you will transfer only newer files, even if the previously uploaded files are not on the server anymore.
The example is for downloads with
Session.GetFiles
, but it will with small changes work for uploads withSession.PutFiles
too.It also points to another article: Remember already downloaded files so they are not downloaded again, which shows another method – To store names of already transferrer file to a file and use it the next time to decide, which files are new.
QUESTION
I have a Java server technology (Ignition by Inductive Automation specifically) that calls a batch file that is meant to use WinSCP to transfer some text files overnight to our customer. It is not working and I am not sure why.
Here is the batch file – actual information has been changed so any typos are not representative of actual batch file. Note that
...ANSWER
Answered 2022-Jan-17 at 07:22To me it looks like this issue:
Why is uploaded file not showing in a remote directory or showing with a different name?
The code 3 is most likely a failed attempt to update timestamp of the just uploaded file that was meanwhile deleted/moved. Why it sometimes succeeds and sometimes fails can be just timing issue. Sometimes WinSCP might manage to update the timestamp before the file gets deleted/moved, sometimes not. You may want to disable timestamp update with -nopreservetime
switch of the put
command.
QUESTION
I have a batch file that receives an argument then passes that argument to a text scrip file that invokes WinSCP to download a file.
My goal is to download today's file.
I am able to download the file if in the text script file I don't have >=today
.
What do I need to change to download today's file, if it exists?
Batch File
...ANSWER
Answered 2022-Jan-13 at 19:27I do not think this is about passing parameters.
But the today
keyword is a "recent" feature (WinSCP 5.14 from October 2018). So you probably have an old version of WinSCP that does not support it.
If you do not have a version of WinSCP that supports today
, you can use %TIMESTAMP%
pattern:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WinSCP
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page