How to delete files on ftp??

Hi !
How i can delete files on ftp (ftp with login and password) from specified directory (all files in it) ??

plz help - what must i paste to automator’s “run applescript” action?

p.s. i found that code (below) but it deletes only specified file ( variable- “filename” )! I need to delete all files in directory 1 !!

code :

set ftpUser to “login”
set ftpPass to “pass”
set fileName to “filename”
set ftpServer to “ftp.server.com/directory1/

set ftpRes to deleteFileOnFTP(ftpUser, ftpPass, ftpServer, fileName) of me
log ftpRes → contens of specified directory or error message

on deleteFileOnFTP(ftpUser, ftpPass, ftpServer, fileName)
set fText to quoted form of (“ftp://” & ftpUser & “:” & ftpPass & “@” & ftpServer)
set aText to "echo ‘delete " & fileName & "’ | ftp " & fText
set resText to do shell script aText
return resText
end deleteFileOnFTP