This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!
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
Hi @warrencowan,
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
Hey @warrencowan,
Could you please post the workflow you are having so far?
Thanks,
Paul Noirel
Sr Customer Customer Engineer, Alteryx
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.
Thanks for sharing @warrencowan.
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
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.
Happy to share this - after so much struggle finally able to download and delete the files from SFTP by using WinSCP.