community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.

Upload a file to FTP with the Run Command tool

Alteryx
Alteryx
Created on

 

We have a couple of great articles on uploading to an FTP location (File Transfer Protocol (FTP) Download and Automating File Transfer Protocol (FTP) Downloads). But what if these options do not work for you? There is another option you can try using the Run Command tool!

 

You can input your file you wish to upload and connect it to a run command tool or you can connect the Run Command tool at the end of your process when your data is read in to be uploaded:

 

 

1.png

 

In the Run Command tool, you will have to populate your output file in the Write Source section. You will also have to point to a .bat file that has the command for the Run Command tool, to upload to your FTP location. Lastly, if you wish to continue your process after your file has been uploaded you can choose to Read Results and you can connect additional tools/process to the right output tab of the Run Command tool:

 

1.png

 

Now, before this will work properly you will have to create your .bat file that houses the command for the run command tool in Alteryx to upload your file to your FTP. The .bat file will simply call on a .txt file that contains a script.

 

.bat file:

 

1.png

 

The contents of the script txt file is where all of the credentials and commands for uploading to your FTP are stored and will have to be constructed like the following:

 

1.png

 

Replace ftp1.extendthereach.com, username, password, and C:\filelocatoin\TestFile.yxdb with the correct info for your file and connection to your FTP. Once you have both your .txt and .bat file created, saved, and connected to in the run command tool you are all set to upload to your FTP!

Comments
Asteroid

Hi there, 

 

I'm wanting to download from an FTP rather than upload.  What connects to the Run Command in this case?

 

Would someone be able to post an example?

 

Many thanks,

Paul

Asteroid

Hello,

 

 

I have some request as Paul.

 

Paul did you find a solution ? or Would someone be able to post an example using the run command tool to download FTTP sources ? 

 

Thank you 

Asteroid

Hi,

 

I ended up following the steps in the link at the top of this page:

 

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/File-Transfer-Protocol-FTP-Download/ta-p/105...

 

I did struggle to get it to work for a while and discovered to my frustration that it is case sensitive and so it was a simple fix.  My best advice is to be very careful when typing in the ftp address etc.  Otherwise, worked ok without problems.  The link contains an example.

 

Cheers,

Paul

Asteroid

Paul and Fx, to upload or download should be the same exact process, in fact can even occur in the same stream.  You just need to specify different FTP commands in the ftpscript.txt file that MikeA mentions.

 

There are hundreds of sites with details on ftp commands, but what you are looking for is:

"put" will upload, moving file from local system where Alteryx is running to your remote ftp site

"get" will download, moving file from the remote ftp site to your system