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.
Here is an example workflow that deletes files from an SFTP using a combo of the Download & Python tools. The example should be pretty straightforward, you just need to plug in your SFTP info in the necessary places (the red Comment boxes indicate tools that need to be updated).
Please let me know if you have questions, happy to help.
Unfortunately, as others have already pointed out, the Delete function in the download tool is not the same Delete function used against an FTP server.
I was able to make some edits to get my files up since I am working with PDFs and don't need to parse dates so. I also updated the Python tool as directed with my credentials ftp site as well as the URL field so it knew exactly which folder these files are in to delete. I attached some screenshots, so please advise if I am overlooking something. Thank you!
Thanks. I do need the subfolder to be identified in this case so I updated it, but I am still seeing a handful of errors in the Python app that I'm not sure how to correct. Any suggestions on how to troubleshoot? I attached a screenshot but am not knowledgeable about Python to figure out.
First run the workflow with some test data (Perhaps put a test pdf in your SFTP directory).
Open the Python tool and run each cell (Ctrl+Enter), one at a time. This will make it a bit easier to debug. You need to run each cell in the Notebook in order (top to bottom). If you change a variable, you always need to rerun the cell
Make sure you've set the variables correctly:
user = 'Username' pw = 'Password' ftp = 'upload.testftp.com'
ftps.cwd = 'DirectoryName'
Edit - One more thing to check, the data flowing into the Python tool should have a field name Filename, which is the list of files to be deleted.
I have added a screenshot below that shows what the output should be for each cell.
Thanks for the continued help. I did check everything and believe my Python tool matches yours verbatim (of course with my credentials instead of the generic ones) but still have the same error. I did notice one thing. I am trying to connect to an SFTP not FTPS. Your configuration seems to reference "ftps" which normally wouldn't be an issue since it's just a label but am wondering if the first cell which calls the "FTP_TLS" should be configured differently? I'm certainly no FTP expert, but from what I understand, TLS is associated with FTPS, not necessarily SFTP? Hoping I'm onto something