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) Download

MattD
Alteryx Alumni (Retired)
Created

Need to download a file from file transfer protocol (FTP) in a Designer workflow? The attached workflow and configuration steps needed to get you all set you up are below!

 

1. Update your URL field in the first Text Input Tool to have the correct FTP URL/filename.extension. Also update your Download To field to point to your desired directory\filename.extension:

 

1.png

 

If the Download To directory is left as .\, the file will be downloaded to the directory the sample workflow was saved in.

 

2. Update FTP site credentials in the Connection tab of the Download Tool:

 

 2.png

 

The other tabs of the download tool are already configured. They make use of the Payload HTTP Action GET (or FTP) (a) and specify the FTP URL, as well as the filename to download to (b).

 

(a) 

3.png

 

(b)

4.png

 

3. Update your Input Tool’s filename to look for the same filename used in your Download To field from Step 1:

 

 5.png

 

There you have it! You should be successfully downloading your FTP file to your intended directory and opening it for use in your workflow. As always, if you’re experiencing any issues don’t hesitate to reach out to our Customer Support team at support@alteryx.com! 

 

Want to learn more about the Download or Text Input Tools? Try the links below:

http://help.alteryx.com/current/index.htm#Download.htm

http://help.alteryx.com/current/index.htm#TextInput.htm

 

Matt D

Attachments
Comments
Keevin77
5 - Atom

Thanks for the write up, helpful, but I am running into an issue for my ftp Get.  I get error on my download tool:

 

Error transferring data: FTP: couldn't retrieve (RETR failed) the specified file

 

Any thoughts?

Pliew
6 - Meteoroid

Great tool. Wanted to clarify, I run a download for a large set of zip files. After the run completed, I noticed some of these downloaded only with have a size of 1kb (i.e. not a full download). If I re-run for smaller set of the same files - it is ok. Just wondering if there is any limitation of size per run or things like that?

jcardoso
8 - Asteroid

Hi, how do you pass FTP details dinamically, to a workflow?

The idea is to have a file/table, which has multiple rows with ftp connection details (host,user,pass,port) in order to do whatever, let's say download file1.csv. How do you pass the connections to the FTP tool dinamically to do it row by row?

And where in the Connectors <Download> Tool, do you setup the host?

The process would be: Connect to row1, ...do whatever..., Disconnect, Connect to row2...

Regards,

 

MattD
Alteryx Alumni (Retired)

Hey @jcardoso!

 

I'd take a look at this article on automating FTP connections!

 

Best of luck,

MattD

Raghu_s
8 - Asteroid

@Pliew amazing question. I just hit the same problem where we need to get zip files from the URL. its unfortunate that Alteryx doesnt not support zip formats as outputs and we are struck with automating this piece. 

 

Looks like this question has been posted a year back, @MattD any provisions for this kind of file formats? I see many posts for converting a file into zip and then uploading in SFTP but was not able to find some leads for direct ZIP file downloads? 

 

Can you help?  

Fz
8 - Asteroid

Hello, 

 

Thank you for your share, I try to do the same method to set up a FTP download connection but I have an error (error opening file: the syntax of the file, directory, or volume name is incorrect). I joins a Screenshots off error. 

 

In my case, I want to download a file .ZIP it’s possible?

 

 

Thank you in advance for your answers .

mattamidus
7 - Meteor

Does this work with SFTP?

AmitBelagali
8 - Asteroid

Hi @MattD,

 

I am trying to download data from FTP. There are around 4-5 files that I need to download and perform some analytical stuff on that data. But when I try to download the file by following your method, I get error saying "Error transferring data: Access denied to remote resource". 

 

Could you please help us on who do I resolve this.

 

Thanks a lot for your help,

 

Thanks,

Amit Belagali

Raghu_s
8 - Asteroid

@AmitBelagali

 

Some troubleshooting tips:  

1. Check if your IP address is open to access the FTP location if its a different machine fore where you are trying to PULL. 

2. Check for the proper Location path. Ex: the destination folder should end with / to access all the 4 files. 

3. Check for the connection timeout set up in the Connections tab. say 10000

4. Try Increase maxing connection number. 

5. File formats extensions and entire path for the files. 

6. Lastly how you parse the request matters, for each file it can be a different record input too if you are pulling different formats. 

 

keep me posted on your try. 

Good luck! 

MD2050
8 - Asteroid

Hello @MattD

Thank you for the information.

Is there a way to pull multiple CSV files from FTP site ?  will we need to use a wildcard? in the below snippet i want to pull all the files with ".csv" extension and drop them to another shared drive location . Thank you for your help.

 

 

 input_tool.png

 

download_configure.png

 

Ferrari
7 - Meteor

Hi ,

In the text input I inserted a second column where I indicated the path to save the data; after which I entered the "filename from a field" in the basic third banner window by selecting the column with the specified path. But when I send the workflow to run, I get the following error message:
  "Error: Download (1): Error Opening file: C: \ Users \ Documents \ download: Access denied. (5)".
Thank you in advance for availability

Ferrari
7 - Meteor

I modified the path and inserted the name of the files that should download but the zip file that is generated is empty, and then reading the result in the browser tool known this:

"DownloadHeaders"

"HTTP / 1.1 401 Unauthorized"

Raghu_s
8 - Asteroid

@Ferrari There are bunch of checks I would do after seeing an error as you posted.  you can try the following trouble shooting tips: 

 

When you download the contents from FTP site via download tool the output would have three variables, Location, DownloadData and DownloadHeaders.

 

So the DownloadData holds all detail information on files that are present in the FTP. You need to process  that information to get out your file URL that needs to be sent for download tool again in order to save it to disk. 

 

if you have crossed it, then 

 

1. check out the address of the FTP link. Few work if the IP address is given. Ex: use ftp://10.301.56.121/folder1/folder2/ instead of ftp://abcfileservice.com/folder1/folder2/

2.if thats all working, then Can you try locating the target location to another drive? I suspect the authorization issue may be due to limitation of external tool like Alteryx to access your users/Documents folder. 

3. Zip file empty - am not aware whats the size of the file, so try to increase the timeout under connections window to 20000 and max connection to 10 or so. 

4. if you have moved the WF from one machine to another but not updated the required inputs/output locations then it might me a reference issue. 

5. How many such files are you trying to pull out? its is one then this should work, if you are tying to pull multiple zips then you need to prep a iteration beforehand that will feed full URL into the download tool to process. 

 

Share your workflow and I can take a look into it.

twheeler
7 - Meteor

I have been trying to get this to work following the instructions above for weeks now.  I just wanted to test downloading a simple CSV file from an SFTP site.  I have worked with my IT to make sure I have proxy server info entered and credentials.  However, when I try to download the file, I get an error in the DownloadHeaders: http:/1.1 400 Bad Request.

 

I am able to download the file using the same credentials through Filezilla.  Not sure what else to try next.  Is there something I need to add to the Headers tab?

 

Any help would be greatly appreciated.

Raghu_s
8 - Asteroid

@twheeler hello! Looks like the file or the folder doesn't have permissions to access or could be a simple syntax issue. Some checks,

 

1. Determine the file size and format 

2. Kindly check your slash format for accessing the folder 

3. what are the fields types you are getting? 

4. Try to increase the timeout connection to 10000 and maximum connection to 5 and test the overall process. 

 

Please share your workflow without credentials, can take a look into and see whats happening. 

twheeler
7 - Meteor

@Raghu_s Thank you so much for your response.  I was able to try some of your suggestions, but they didn't work.  However, I did get hooked up with someone else at Alteryx who was able to help me via e-mail.  Thanks again!!

Raghu_s
8 - Asteroid

@twheeler Cool. So what was the issue and fix exactly? Can you post the example so it would helpful for everyone here if we are struck. 

twheeler
7 - Meteor

@Raghu_s  I was not using SFTP in the file name when I was referencing port 22.  Also, it was suggested that I use the Block Until Done tool and Dynamic Input tool to make sure download was complete prior to reading into Alteryx. 

 

I would be happy to attach the example, but I don't see a way to attach the workflow.

myende
5 - Atom

I have been struggling to connect and download the file on SFTP. I'm using the correct url and port and still, workflow gives an error 

SFTP.JPG

 

SFTP2.JPG

 

I can connect to the FTP server through WinSCP using the exact same credentials and ports. In the Connections tab in download tool, I have mentioned maximum connections = 11 and timeout = 10000.

 

Can someone please let me know what am I missing?

Raghu_s
8 - Asteroid

@myende  can you try the following,

 

1. Just try ignoring s in sftp path.

2. Can you also try giving the actual file path the download? 

3. Two connections is more than enough. not necessarily you need to have 11 connections. 

4. Try to post the configurations screenshots so we can look into where is the issue. 

ac_123
5 - Atom

How can I use the "GetEnvironmentVariable" for username and password for this FT?  I do not want to embed the password.

RodLight
8 - Asteroid

@ac_123 

According to Help...

GetEnvironmentVariable(Name): Returns the environment variable specified in Name. To get a list of environment variables, go to Control Panel > System > Advanced System Settings > Environment Variables. A list of system variables appears. Any value from this can be used.

 

Since the password is not stored as a Windows Environmental Variable, I don't believe you would be able to retrieve it...although USERNAME is a system variable. You could also build a macro around the process where the user's password is entered by the user (and can be masked within the macro). 

 

Keep in mind that the format to get that is...

GetEnvironmentVariable('TEMP')

The variable you are calling needs to be in quotes.

pradeepid
5 - Atom
I get the following error "unable to open archive for unzipping"
cam_w
11 - Bolide

@MattD -- Can you help confirm?

 

It appears from the various Knowledge Base articles and the official help documentation:

 

https://help.alteryx.com/current/Download.htm

 

That access to cURL's options is not possible using the Download Tool. For example:

 

https://curl.haxx.se/docs/manpage.html

--list-only

 

 

I've come across a number of ways I'd like to use the Download Tool, but not being able to access the options parameters is preventing me from using it.

 

Thanks for your time!

MattD
Alteryx Alumni (Retired)

Hey @cam_w !

 

You're correct about that. While you can't use cURL commands in combination with the Download Tool, you can do so with the Run Command Tool by running the cURL executable and supplying it with syntax, much like the methods below:

 

Run Command Tool Mastery

cURL Command Dynamic Values

 

If you you need help transcribing between Download Tool options and cURL syntax, these resources are a great starting point:

 

APIs in Alteryx: cURL and Download Tool

cURL Docs

 

You can also try to repurpose the macro I use in this instance.

 

Best of luck,

MattD

SmithD_ATK
5 - Atom

HI @twheeler,

 

Could you provide a screenshot of the url changes you made to connect to the SFTP? It sounds like I am having the same issue you were. I put the comment below, if anyone else has a solution for "access denied" when trying to connect to SFTP that would be great. 

 

 

 I was not using SFTP in the file name when I was referencing port 22.  Also, it was suggested that I use the Block Until Done tool and Dynamic Input tool to make sure download was complete prior to reading into Alteryx. 

 

I would be happy to attach the example, but I don't see a way to attach the workflow.

 

 


 

Thanks

jschroeder
7 - Meteor

I have been trying to post  or put a file to a FTP site and not able to get to work.  I am able to download files just fine.  Has anyone been successful in doing this with the download tool?

 

Best,  

 

John S

Kiran2
5 - Atom

Hi,

 

You need to check in the below options, to have the file downloaded to the local machine

 

Input1.PNGInput2.PNG

 

Hope this helps!

 

Thanks,

Kiran

johnnykoung
8 - Asteroid

Hi,

Is it possible to not download the file and read directly from the SFTP server?

Thanks,

Johnny

Nandy
8 - Asteroid

how to specify the FTP link in download tool and FTP site consist of numerous files; how to specifically search a required file and download to local c drive.

 

what is there in destination address is the FTP right , after which i had to paste another text to load list of files in it.

 

Nandy_0-1571853901102.png

Thanks,

Nan

usmost
5 - Atom

Hello @MattD,

 

Thanks, for the FTP download workflow article.   Could you confirm if Alteryx have any provision for an SFTP  "push"  workflow where files are sent out to another secure SFTP client-server?    The client servers require a data push, time increment ranges but is typically five-minute,  ANSI compliant passwords - file export formats .csv or .html. and email reporting tied to the success and failure of the file transfers.  

 

Any help would be greatly appreciated. 

 

 

 

KCAgentProvocateur
8 - Asteroid

 

How do i make sure the URL is picking up a file with todays date? and then i am downloading to a file with todays date?

 

KCAgentProvocateur_0-1575909016949.png

 

Thanks in advance!

Nandy
8 - Asteroid

Hi ,

 

i tried the above steps to download file from FTP , but i get this error. help me to fix it

Nandy_0-1580658942220.png

Emily9
5 - Atom

Any ideas on why this is working locally but not on the gallery? 

umeshlohani07
5 - Atom

@ MattD,

 

Download tool works well if we know the filenames.

 

Is there any way if file names itself keeps on changing everyday while all other details remains same.

 

Thanks.

 

BR

Umesh

Jes
8 - Asteroid

Something that keeps coming up in the comments is:

"How can we input a directory of SFTP/FTP and select a specific file by introducing wild card into the folder path".

Any suggestions would be appreciated. 

 

Sam7
8 - Asteroid

Hi, 

 

I have set-up the my SFTP files, and they all work (I think).  My error states: Error transferring data: Remote file not found 

I know what tool this is, a DYNAMIC RENAME TOOL, so can;t workout the issue.  I use the same set-up to connect SFTP files on three onther connections and the error is a Remote File Not found. 

 

What does this mean?  And how can I resolve this?

 

Thanks

Amulu
5 - Atom

Is the file you are attempting to process available in the FTP site?

smugabart
8 - Asteroid
8 - Asteroid

Hi all! I have a question regarding the security of this connection.
Based on your experience is it a safe enough approach? How that connection looks like from the technical perspective?

I am working on the confidential data and I want to be sure. thanks

Shaaz
9 - Comet

Is there a way to just get all the filenames available in SFTP directory ? I dont want to download the data, just directory information.