Delete FTP - get file list

More
1 year 4 months ago #24913 by BPO
Hi,

I add configured a package so it download files from an FTP and then delete them. (by use of FTP download then FTP delete files).
I want to made a secure delete of only downloaded file, is there a way the download package can inform the delete one of files to be deleted ?

Thanks
 

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago #24916 by admin
Replied by admin on topic Delete FTP - get file list
The way I would tackle it is to download all files than loop over downloaded files and delete them from the ftp server. I can create an example for you if you wish. It is very easy to implement. 

Mike
ETL Architect

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago #24917 by BPO
Replied by BPO on topic Delete FTP - get file list
I seen the way you see to handle it,
The example will be welcome,
thank you
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago - 1 year 4 months ago #24926 by admin
Replied by admin on topic Delete FTP - get file list
Here is promised example



I used the following script to get file name from full name
begin
 Result:=ExtractFileName(GetVariable('#LoopValue#'));
end;

Package is also attached

File Attachment:

File Name: ftp-example.zip
File Size:1 KB


We are planning create explanation video next week and publish it on our youtube channel

www.youtube.com/@Etltoolscom  

I hope you will find it useful
 

Mike
ETL Architect
Last edit: 1 year 4 months ago by admin.

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago #24928 by BPO
Replied by BPO on topic Delete FTP - get file list
Thx,
I just tested it successfully.

Also I see you loop over deleting to handle several files, May it be done by looping all file name at once ? (just curiosity)

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago - 1 year 4 months ago #24929 by admin
Replied by admin on topic Delete FTP - get file list
If you are downloading an entire folder, you can delete all files from the FTP folder using a mask.

I am using a loop because you wanted to perform a safe delete.

Keep in mind that while you are downloading the files, someone might upload a new one.
Therefore, using a mask to delete all files is not a safe option.

Mike
ETL Architect
Last edit: 1 year 4 months ago by admin.

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save