How to delete dynamic sub directories in a FTP directory in SSIS?

185 views Asked by At

I have a directory in FTP named Client and each day sub directory is created with dynamic naming with the current date like Client/6_15_2015 .And there will be some files in that sub directory. Now i wanted to copy the sub directory and delete the sub directory everyday.I have used FTP task to copy the sub directory and it worked fine.but i am unable delete the dynamic named sub directory. how can i give the dynamic sub directory for remote path in FTP Task for Operation 'Remove Remote directory'.

Thanks in advance

1

There are 1 answers

0
Eric Hauenstein On

I don't usually use the builtin FTP tasks, but this should work for you:

  1. Create a variable that uses an expression to dynamically assemble the remote path. Something like "/Client/"+(DT_WSTR,2) MONTH( GETDATE() )+"_"+(DT_WSTR,2) DAY( GETDATE() )+"_"+(DT_WSTR,4) YEAR( GETDATE() )
  2. Set the remote path is variable option to the variable you created.
  3. You may need to tweak the expression logic a bit to get this to correctly match the date format. FTPSettings