We help IT Professionals succeed at work.






The File Transfer Program (FTP) is a standard network protocol used to transfer computer files between a client and server on a computer network. Built on a client-server model architecture, it separates control and data connections between the client and the server. Users may access the server through a sign-in protocol, typically in the form of a username and password.

I wrote two C-language programs almost 15 years ago, one that uploads files to an FTP server, one that downloads files from an FTP server.  The two programs are essentially identical in that I'm calling Windows functions as follows:

1) InternetOpen - to obtain a handle to an open Internet session.
2) InternetConnect - to obtain a handle to an open FTP session.
3) FtpDeleteFile - to delete the file being transferred before transferring the new version of the file.
4) FtpPutFile/FtpGetFile - to upload/download the file to/from the FTP server.
5) InternetCloseHandle - to close the handle to the FTP session.
6) InternetCloseHandle - to close the handle to the Internet session.

These programs have been working for the past 15 years and they both have the FTP server credentials "hard-coded" so they're not multi-functional, but were designed for my specific needs.  Now the corporation that I provide my software application services to are requesting that I use SFTP rather than FTP to adhere to their enhanced security guidelines.  I've searched the Internet for information on SFTP, but I haven't found anything that really provides any real insight into what I could do to change my existing programs to work with SFTP.  

Frankly, I don't really understand what I need to do to even set up an SFTP transfer, much less automate it, which is the primary advantage with using my own programs, since I can set up a command file to transfer ALL the files I need to transfer on a …
I have a WinSCP batch file that I am trying to utilize for uploading a file.  The batch when run does open, but logs in only and does not upload the file or exit even from the script.  Just keeps the window open.  Any help would be greatly appreciated.  Attaching file.
Hi Experts

Could you point the better strategy to deploy a Laravel project at host ?

My hosting provider offers cPanel.

(I intend to do that to my own site)

Another option could be FTP - but I guess to transfer a complete Laravel project (with vendor folder) would be cumbesome to be done that way.

Thanks in advance.
Dear expert

Im trying to send a file to ftp using winSCPnet.dll it not working I got output:

Exception calling "Open" with "1" argument(s): "Connection failed.
Connection failed."
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException

I could not find anything wrong with the code below, I tried with winscp to connect that worked, so it was not connect problem. Anyone know how to I can send a file to FTP using Powershell?


Add-Type -Path "C:\Users\sewetia001\AppData\Local\Programs\WinSCP\WinSCPnet.dll"
    $session = New-Object WinSCP.Session
$sessionOptions = New-Object WinSCP.SessionOptions

$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = "Hostname"
$sessionOptions.UserName = "User"
$sessionOptions.Password = "Passwrd"

try {


} catch {
    Write-Error $_

Open in new window

I would like to run a powershell command:
Get-Process "auto ftp manager" | Where StartTime -lt (Get-Date).AddMinutes(-30) | Stop-Process -Force
every 12 hours on a server automatically.
I was thinking to use a batch file and windows scheduler to run it.
How do I make the powershell command run from a batch file?
Is there a better solution to achieving this task, i.e. running the ps command automatically every 12 hours?
Hi all,

We have squid proxy server on Ubuntu 16.04 in our company and use Cisco ASA redirects the Internet traffic through wccp tunnel. We planed to upgrade the Ubuntu to 18.04 recently.

I setup the new proxy server on Ubuntu 18.04 in a test environment, but the wccp didn't work.

Here are the configurations and some troubleshooting steps I have taken:

### Squid config
acl localnet src  # RFC 1122 "this" network (LAN)
acl localnet src             # RFC 1918 local private network (LAN)
acl localnet src          # RFC 6598 shared address space (CGN)
acl localnet src         # RFC 3927 link-local (directly plugged) machines
acl localnet src          # RFC 1918 local private network (LAN)
acl localnet src         # RFC 1918 local private network (LAN)
acl localnet src fc00::/7               # RFC 4193 local private network range
acl localnet src fe80::/10              # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # …
Hello, Experts,

I am new to the encryption world. I have some python experience under my belt but not much when it comes to encrypting passwords. I have compiled a python script that is very simple. It queries a directory > grabs a specific type of file > starts a FTP transmission > ends.

Currently, in testing, my python script has the URL, username, password in cleartext. For obvious reasons, I want to move away from that. What is the best practice to encrypt my data?

  • Script will be downloaded from an FTP host to various machines
  • The script will be placed in a hidden dir
  • Service will run to kick off-script during an interval

It would make sense for me since this script will be deployed globally to encrypt password once, store in some sort of file, then reference later in the script.

I am looking for some pointers, examples, and best practices.

#import libraries
import os
import pysftp

# query for file to ftp
alr_file = '/Users/path/to/file/to_ftp'
ftpALR = []

def findFile():

    for item in os.listdir(alr_file):
        if item.endswith('.mdb'):
            ftpALR.append(alr_file + '/' + item)

# ftp transmission function
def ftpTransmit():
    # list ftp dir
    cnopts = pysftp.CnOpts()
    cnopts.hostkeys = None
    with pysftp.Connection(host='ftp.acme.com',

Open in new window

I'm learning and doing some dev work on a bluehost server. If i give ftp access to someone to a specific folder, it seems they can access other parts of the server outside of that folder by using php.

What steps do I need to take to ringfence that activity and restrict it to one folder (and it's subfolders)?

Many thanks
I'm behind a SonicWall TZ400 and I need to upload a document to an external FTP server ftps://ftp.xxx.xx:990 IP but I get a error that I'm unable to connect to the server. I think the firewall might be blocking access. What is the best way to open up for access to this site?

Does anyone know what is a "FTPP_FTP_MALFORMED_PARAMETER", I am seeing this in our logs.
I have a client that is running Windows Server 2016. They have two FTP sites (behind a VPN firewall) on Ports 21 and 21000. The reason they have 2 FTP sites to to accommodate different aspects of their business.

These FTP sites recently stopped working for no obvious reason and I've set-up SFTP for them.

Following an online set of directions I found [1], I am able to have certain users land in a given folder (e.g. ~\ProgramData\ssh\sshd_config) with the directive:

ChrootDirectory D:\FTPSites\Site

Open in new window

Otherwise it defaults to C:\Users\UserName, which is not acceptable to them long-term.

Is there a way to have SFTP go to a different directory based on the local user accessing the server? Or is SFTP limited to only one folder a user can "Chroot" to?


[1] https://tech.xenit.se/installing-and-configuring-sftp-server-on-windows-server-2016/
I am troubleshooting an existing FTP Connection in Windows Server 2016. This FTP connection has it's bindings in IIS set to port 21:

I can Telnet to that server from the client via Port 21.

I am getting the same errors on both the client and the server, but what's really strange is that there is a random port at the attempt of connect. Things like:

2020-01-24 14:49:14.389 Connecting to ...

Open in new window

2020-01-24 14:49:14.389 Connecting to ...

Open in new window

Is there some sort of dynamic port range that I missed? These numbers seem low for that, but I need a sanity check from someone who has seen this before.

I figured that the FTP would connect over Port 21, as I bound that in IIS.

Thanks for your help!
I am running Windows Server 2016 and have two FTP sites setup in IIS (one using port 21 and one using 21000). Both aren't working for me and I need a sanity check to get these working today.

It's not networking because I can successfully Telnet into the Server on those Ports. I have been over permissions a dozen times, comparing exactly what's in Production (what I know works) with what is on this STAGE server, but it still seems like that's an issue (based on the status codes below).

I'm stumped as to a next level of troubleshooting. I even recreated the FTP site in IIS from the ground-up and am still getting the same results.

This is the error I'm receiving:

Transfer channel can't be opened. Reason: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Could not retrieve directory listing
Data channel timed out.

Open in new window

Both the local logs and server logs jump from "227" ("Entering Passive Mode") to "550" with "Data Channel Timed out" ("Requested action not taken. File unavailable (e.g., file not found, no access)").

Thanks in advance for your help.
I can't seem to get FTP working when I bind it to a host name on IIS (version 8.5).  When I enter a hostname under the IIS FTP binding, I cannot connect.  When I enter nothing under the hostname, however, I can connect just fine.  How can I bind FTP to a specific hostname?  I want this so I can have 2 different websites using FTP on the same server.  Here is a screenshot:    

In the screenshot, I put the hostname in and then I go into windows explorer and type ftp://theravive.com and I cannot access anything.  WIndows gives me the message seen in screenshot 2.   If I leave the hostname blank in the FTP bindings, everything works fine.  What am I doing wrong?  My goal is to have 2 different websites with FTP.  By leaving the hostname blank, my second website keeps FTP'ing into the first website.  Would love some help, thank you!

I installed Filezilla server 0_9_60_2 on a Windows Server 2016 box with default options.  Am unable to get the admin UI to appear though.  It is running per the task manager but not appearing on the screen.

I looked at other similar issues online and they refer to a 'start minimized' option that should be set to 0.  I see nothing like that in the current xml configuration file.  


I am trying to log sonicwall capture logs to an FTP server but it fails I have attached a pcap file of the failurefailed-ftp.pcapng
I have  Canon EOS 7D with a WFT attached.   I need to set up an FTP server in Windows 10 Professional X64.   I have set up the site in IIS, but I cannot get the WFT to connect to the FTP server.   I get the error 45 or 41, cannot connect to the FTP server.   The WFT connects to the router, but is not able to get any further.
Hello, so I've been trying to fiddle with iptables for my web server. Everything is working except for passive ftp and I can't seem to get it right.

Here are my iptables rules:

-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 20 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p tcp -m tcp --sport 1024:65535 --dport 1024:65535 -m conntrack --ctstate ESTABLISHED -j ACCEPT 

Open in new window

I have the line IPTABLES_MODULES="nf_conntrack_ftp" in iptables-config

Anyway, all ftp users aren't able to connect (they are if I disable iptables).
To put it better, they do connect but then they can never reach their root directory and they get an error saying the / directory couldn't be found.

So there must be something wrong in my IPTABLES, but I can't find it for the life of me. I've followed every guide I found and I can't find my mistake.

Can you guys lend a hand?
trying to figure out how to modify an xml version 1.0 script to allow several files to be picked up by an ftp server. We have a current script in place that was created many years ago.. we haven't have to change it but now have the need.
Here is the script below... what I am trying to do is get the last documents (pull file 3 and 4) to actually recognize and pull the files. The file names are also listed below...

<?xml version="1.0" encoding="utf-8" ?>

NOTE: CU Contact Info


 <!-- NOTE: ftp dirs lowercased-->


        <add key="archiveDays" value="60"/>
        <add key="archiveDirectory" value="archive"/>

      <!-- FTP Server INfo -->
        <add key="FTPServer" value="" />
        <add key="FTPUN" value="confidential" />
        <add key="FTPPwd" value="confidential" />
        <add key="FTPPort" value="22" />

        <!-- Log file info -->
        <add key="LogFile" value="\\blgappserv1\infinity\CreditUnionFTP\work\logs\BLGFeed.log"/>

        <!-- To/From paths-->
        <!-- <add key="networkRootDirectory" value="P:\PCFS\" /> -->
        <add key="networkRootDirectory" value="\\blgdcserv1.blg.local\data\PCFS\" />
        <add key="networkSourceDirectory" value="Exports" />
        <add key="networkDestinationDirectory" value="Imports" />

        <add key="ftpSourceDirectory" value="export" />
        <add key="ftpDestinationDirectory" value="import" />

Hi Folks,

I have a file, which I need to sort and segregate the Transaction sets and transfer each transaction set into an FTP folder as a separate file. PFA is the original file "file-a.txt", With the help of other experts in the community using the program "sortingMultiEDIrecords.txt" I am able to segregate the Transaction sets into multiple output files in my example it is "output-1.txt", "output-2.txt" and "output-3.txt". Then I used another program "ftpFileUpload.txt" to upload these output files into an FTP server in a specified folder.
            Now the issue I have is I am having trouble doing this 2 stage process in my server in which I will be deploying. So I am looking for one Java program which instead of genearting the output files into a folder and then picking it up from there to upload into FTP, I am looking a for a solution where in the outputs are directly FTPed in teh FTP server. So instead of the BusortingMultiEDIrecords.txtsortingMultiEDIrecords.txtftpFileUpload.txtfile-a.txtoutput-1.txtoutput-2.txtoutput-3.txtfferedWriter which writes to an intermediate storage should actually directly write it into the FTP folder. PFA all the programs and files. I would appreciate the feedback and sample code if possible.

Hi Folks,

I have an EDI file, which I need to sort and segregate the Transaction sets and transfer each transaction set into an FTP folder as a separate file. In the attachments I have "File A" which is the actual input file and "File B" shows format after the sort to show the individual transaction sets and finally 3 files "Output 1" , "Output 2" and "Output 3" which have to be extracted out of the File B and have to be sent to an FTP server. The idea is to directly extract the Output 1 , 2 and 3 from File A. I have shown the File B to depict what I meant by Transaction sets.

Each Transaction set consists of the following components in that order. Please check the file "File_A_components" which shows the highlighted components from the "File A" for reference.  I would need suggestion on how to generate Output 1, 2 and 3 separate files into an FTP server using Java. I am an amateur in JAVA. So please provide as detailed as possible.

Transaction Set components
ST set

I'd like to use a script in a batch file to perform a file transfer using ftp.
 I can not figure out the syntax

The full path for the file I want to upload is:  \\myserver\database\myfilename.csv
Assume my ftp account is:
My password is: MyPassword

The root folder of my ftp account is httpdocs\ and I would like to copy it into my downloads folder

"C:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /command
"put \\myserver\database\myfilename.csv /httpdocs/Downloads/myfilename.csv" "exit"  

Note: I have spaces between each line in the batch file.. Broke it up this way to make it easier to read.
We have a cloud application that up until 6 weeks ago, was able to send SFTP file transfers to our FTP server.    Now only FTP connections can get through.   I am not an expert at FTP but we set it up years ago and the SFTP connection worked fine.    Now that it fails, I don't know where to look or where to enable the SFTP connection.   Any suggestions on where to look would be appreciated.

I am looking FTP server with FTP, FTPS and SFTP protocol.
I need FTP server in Tenant (Hosted) mode where I can configure different domains (segregation) and assign disk space as per requirement.
If server is windows based than its excellent. I am not looking hosted/cloud FTP server. I would like to host/configure server in our data center offer service to end users.
FileZilla-Server-Connection-Issues-.docxFileZilla Server SFTP connection issue from outside network. I need help resolving issues with sftp connection to filezilla server from outside network. Please see attachment for details for my current Router, FileZilla Server, and FileZilla Client configurations.






The File Transfer Program (FTP) is a standard network protocol used to transfer computer files between a client and server on a computer network. Built on a client-server model architecture, it separates control and data connections between the client and the server. Users may access the server through a sign-in protocol, typically in the form of a username and password.

Top Experts In