I have created a program using vb.net which allows users to upload files on an ftp server and share them via a link that the program generates at the end of the upload.
To save space on my ftp server, I will only be keeping the uploaded files for a set time (in this case 7 days) and would delete files older than that.
For that I am creating a separate program (still using vb.net) that will run unattended on my PC. I am aiming for this to check the ftp server every now and then, check all existing files at that moment and see if they are 7 days or older then delete such files.
Unfortunately, I cannot seem to find a way to "detect" the date the file was uploaded (modified date) and run a procedure to check if it is already more than 7 days old.
I have used the function WebRequestMethods.Ftp.ListDirectoryDetails
but it returns strings which I have no way of isolating the file date (and it also does not provide the year, which would be a problem to compute how old the file is if it was uploaded towards the end of the year)
Any suggestions on how I can get about deleting files on my ftp server that are a certain amount of days old?
Thank you and regards.