Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

File Transfer Protocol (FTP) Upload

MattD
Alteryx Alumni (Retired)
Created

To go along with our example on how to download a file from FTP, we’ve assembled steps in the attachedworkflow (credentials, server removed) as an example of uploading a file to FTP. In this example (attached) I’ve encoded a string field as a Blob to be posted as a text file. Theoretically, all your fields could be concatenated to a CSV format, or another delimited format, to be converted and posted using the same steps:

My field string to be converted:

1.png

1. First identify the field to be converted to Blob in your Blob Convert Tool:

2.png

2. Specify in a Formula Tool your FTP URL and filename in the format URL/filename.extension:

3.png

3. Have your Download Tool use this field as the URL field in the Basic Tab:

4.png

4. In the Payload tab specify the HTTP action PUT and select the option “Take Query String/Body from Field” and specify your Blob field:

5.png

5. Specify your credentials in the Connection tab of the Download Tool, leave all other configuration options default:

6.png

6. Run the workflow!

After running, you should be able to confirm the successful transfer of your file in the DownloadHeader field returned from the Download Tool (it'll also be hosted on your FTP path):

7.png

Take a look at the results below:

8.png

9.png

Attachments
Comments
nchikara
6 - Meteoroid

Hi @MattD,

 

I have a question, until now I was using the .bat file to upload my files and I am interested in using this new tool but its throwing an error "Error: Download (1): Error transferring data: Unsupported protocol". Until now I was using my .bat file along with the URL I provide the certificate of the ftp server as it uses explicit encryption.

 

I would like to know if it is possible to use download tool for uploading files to ftp server which uses explicit encryption?

 

Thanks,

Nancy

edc
5 - Atom

This is great, can you manage key based authentication in the same method within the Download tool?

jcardoso
8 - Asteroid

Hi @MattD,

i have a question, how can you check if a folder exists or not at some ftp account, to perform an ftp/sftp upload?

I was able to create a macro to dinamically, upload into different accounts, using blob tool, my input URL already includes the folder and filename (ftp://host:port/folder/filename.ext) where i'm going to drop the files, but the folder needs to exist. If it doesn't exist, it throws an error.

How do you check if the folder already exists inside the ftp, prior to upload? Would like to know if this is even possible.

Thank you for your time,
Regards,

edc
5 - Atom

I would recommend using the 'Run Command Tool' to execute a PowerShell script that can check the FTP directory and state.

 

Using PowerSheel Within Alteryx

Example of using Powershell to check FTP

jcardoso
8 - Asteroid

Thanks, 

The table before the connection already includes the parameters, as well the full path of the file which which is going to be uploaded, as individual columns (host,user,pass,folder).

 

but how do you pass the parameters dinamically, into the script which is going to run the check if the folder exists or not? Export an external file with the parameters to the same location and take it from there it's not a good solution, i think.

wyattcurtis
5 - Atom

How about an example where you convert an entire flat file (i.e. all the fields and rows, including column headers)?

 

e.g.

Col1,Col2,Col3,Col4

11,12,13,Data14

21,22,23,Data24

31,32,33,Data34

 

 

Paulo1300
8 - Asteroid

Hi @mattd, 

 

I second the request above. I am trying to do this with a Multi-Line file, but the output file ends up being all on one line. I would upload my test workflow but I cannot figure out how. So I took screenshots instead.

 

 Starting with a dataset that looks like so:

Capture.PNG

 

I build a formula like first pic, leading to second pic:

Capture.PNG

Capture.PNG

 

 

 

Then to make it a single field, I summarize it and concatenate by newline (\n):

Capture.PNG

 

Leading to this:

Capture.PNG

 

Then I follow the same stuff above. Convert to Blob, and then Download tool using the same configuration in the example. Everything looks good in Alteryx, but the output is all on one line. I also tried adding a linebreak in the formula, but that also did not work. If I use Convert to Blob again, the linebreaks still exist, just not in my actual file on the FTP server.

 

Output Screenshot:
Output.PNG

Paulo1300
8 - Asteroid

i figured it out. I changed concatenate to "/r/n" rather than just "/n" and it worked.

 

I noticed the linebreaks were in notepad++ but not notepad, which led me to this:

https://superuser.com/questions/783664/notepad-doesnt-show-line-breaks

 

@wyattcurtis in addition to my example above, the link below contains a multi-line example

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Upload-to-SFTP-FTP-More-Examples-with-Altery...

Pkoziol
6 - Meteoroid

I have a question regarding privacy of connection. Is the file being transmitted encrypted? What is a strength of encryption used?