Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.

Delete files from FTP

Highlighted
8 - Asteroid

Hi Community, 

 

Im trying to delete files from an FTP location after they've been downloaded, and am following some steps from another solved post but am not having success.

 

I'm just passing a single URL ftp://ftp.xxxxxx.com/xxxx/text.txt , which is passed from a text input to a download tool to see if I can delete the test file I dropped on the server.

 

Config is failry simple. output to string,  am selecting delete from  the http actions,  and the ftp credentials are correct, but no delete is taking place.

 

Revieiwing the header's shows the following but I'm unable to troubleshoot any further. Can anyone help?

 

220 Welcome to the xxxx FTP server.
331 Password required for xxxxx
230 Logged on
257 "/" is current directory.
250 CWD successful. "/xxxx" is current directory.
229 Entering Extended Passive Mode (|||50205|)
200 Type set to I
213 14
150 Opening data channel for file download from server of "/xxxx/text.txt"
226 Successfully transferred "/xxxx/text.txt"

 

Any advice much appreciated.

 

Dubya

 

Highlighted
Alteryx
Alteryx

Hi @Dubya,

 

Thank you for posting!

 

Did you try options posted there: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Delete-file-from-SFTP/td-p/58285/page/... ?

 

In Download tool "DELETE" is a HTTP methods. As such it would not mean delete in a FTP context.

 

I would suggest to use a Run Command tool instead.

 

 

Thanks,

 

Paul Noirel

Sr Customer Support Engineer, Alteryx

Highlighted
8 - Asteroid
Thanks @PaulN . have actually been trying to do that after draining some of the threads, Inc that one and it didn't seem like they managed to crack it, at least no one followed up to document how they fixed it. I'm having difficulty understanding how to format the url and deal with the credentials part though. I managed to master local file deletion, but not when it's like a url. Any steer you can offer there would be much appreciated.
Highlighted
Alteryx
Alteryx

Hey @Dubya,

 

Could you please post the workflow you are having so far?

 

Thanks,

 

Paul Noirel

Sr Customer Customer Engineer, Alteryx

Highlighted
8 - Asteroid

Hey @PaulN , see below.

 

Nothing special, just a file name and path from an input, formatted into a delete string to push to a bat file. Am following a previous article on how to do this. Works with a local filename and path but not ftp.

 

Have already checked that I can access the ftp location locally through my file explorer.

Highlighted
8 - Asteroid
 
Highlighted
Alteryx
Alteryx

Thanks for sharing @Dubya.

 

You are correct: your method works fine for local files but is not going to work with FTP as this is a different protocol and syntax is different.

 

I would suggest you to look a cURL (a version is available there: .\Alteryx\bin\RuntimeData\Analytic_Apps\curl.exe)

 

A typical command line, to implement using Run Command tool, would look like:

 

 curl -u %USERNAME%:%PASSWORD% %PATH_TO_FTP_FILE% -Q "DELE %FILENAME%"

in your example:

%PATH_TO_FTP_FILE%ftp://ftp.domain.com/FTP/Clients/clientname/folder/test.txt

%FILENAME% : test.txt

 

Thanks,

 

Paul Noirel

Sr Customer Support Engineer, Alteryx

Highlighted
8 - Asteroid

@Dubya 

Were you able to successfully delete files from an SFTP site?  I am trying to do the same but haven't gotten this to work.  Thanks.

Labels