Delete specific files from SFTP

Post Reply
Dave23
Member
Posts: 41
Joined: Thu Oct 12, 2017 4:42 pm

Delete specific files from SFTP

Post by Dave23 »

Hi all,

I was wondering if anyone has come up with a solution to be able to delete specific files from an sftp site? It is our own internal FTP server and unfortunately the api is very limited and so does not allow us to connect via HTTP request.

Thanks
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Delete specific files from SFTP

Post by Padawan »

You'll need to call an external script or command line tool to accomplish this.

There has been a similar discussion in the past:
viewtopic.php?f=11&t=92

(I haven't tried this myself, I just remembered the old topics)
Dave23
Member
Posts: 41
Joined: Thu Oct 12, 2017 4:42 pm

Re: Delete specific files from SFTP

Post by Dave23 »

That's great cheers.

Sticking with this topic.

Is it possible to rename folders or change a folder structure once it has been uploaded onto the FTP server?

My thinking was if I uploaded a folder containing a file eg //TEST/file1.pdf and then further down the line I could either rename that folder to //TEST_DELETE/file1.pdf or add a new folder //DELETE/TEST/file1.pdf that way when i used FTP receive I could grab folders named DELETE or TEST_DELETE.
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Delete specific files from SFTP

Post by Padawan »

Using default Switch tools the only way to rename a folder on an FTP server is to:
- Download the folder from the FTP
- Rename it
- Upload it again to the FTP

If you want to rename the folder on the FTP itself, then you need an external script or command line tool which is able to rename the FTP folder. This external script or command line tool can then be automated in Switch via the Execute Command Tool or a Switch Script.
Post Reply