Deletes an FTP server file.
fsFileDelete( client-handle, remote-file )
(s) client-handle: FTPS extender client handle.
(s) remote-file: name of server file to delete.
(i)@True(1) if file successfully deleted
The fsFileDelete function removes the file named in the second parameter from the FTP server associated with the client-handle parameter. The function errors if the file is not found on the server.
client-handle
FTPS extender client handle obtain by a call to the fsClientInit function.
remote-file
Use this parameter to specify the FTP server file you wish to delete. Include any necessary server path information to the targeted file to insure that the correct file is found and deleted..
AddExtender('ilcfs44i.dll',0,'ilcfs64i.dll') host = 'test.example.com' port = 21 user = 'demo' pswd = 'password' ; Create a client client = fsClientInit(host, port, user, pswd) ; Fetch a list of files in the CustData directory dir = "\CustData" files = fsDirList(client, dir, @fsArray) ; Delete all the csv files from the director ForEach file In files If StrLower(FileExtension(file)) == 'csv' fsFileDelete(client, dir:'/':file) EndIf Next ; Disconnect and remove fsClientDelete(client)