Description

Renames a file from an FTP server.

Syntax

filecontents = FTPRENAMEFILE (ftpdomain, user, password, path, existing_filename, new_filename)

Parameters

The function has the following parameters:

ParameterDescription
ftpdomainThe domain name of the FTP site.
userA valid user of the FTP site
passwordThe password of the user
pathThe location of the file being renamed.
existing_filenameThe current name of the file being renamed
new_filenameThe new filename.

Returns

250 if successful, 503 if failure.

See also

FTPDELFILE()FTPGETFILE()

Example

declare function FTPRENAMEFILE, msg, utility
 
ftpdomain = 'my.ftp.site.com'
user = 'someone'
password = 'a valid password'
path = 'myFtpFiles'
existing_filename = 'How To FTP'
new_filename = 'How to Rename FTP files'
 
message = FTPRENAMEFILE(ftpdomain,user,password,path,existing_filename,new_filename)
 
if message = 250 else
   msg(@window,'Error in renaming file.  Error Code: ';message)
end
  • No labels