Home > Language Reference > FTP Functions > FTPName

FTPName

The FTPName function renames the specified file(s) on the FTP server.

Syntax

ret=FTPName(<old_filename>,<new_filename>)

Parameters

<old_filename>, string, name of the file to rename. Wildcards (* or ?) may be used to rename several files matching a certain mask.

<new_filename>, string, new filenames for the file(s) specified in <old_filename>. Wildcards are allowed.

Return value

Ret, optional numeric return value. If the function succeeds renaming the file(s) within 30 seconds (this default value can be changed using #FTPTimeout), the function returns 0. If the function fails, the return value is a nonzero negative value (see FTP Functions Error Codes).

See also

FTPexistFile

Example

FtpConnect("www.my_site.com","ftp","MX/WH05CZE3h") ' connection to the FTP server www.my_site.com (fake credentials!)
FtpName("/todelete/*.jpg","/todelete/*.gif") ' renames all the *.jpg files stored in /todelete folder.
FtpDisconnect() ' Terminates the FTP connection