Found 1046 Articles for PHP

ftp_mkdir() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

57 Views

The ftp_mkdir() function is used to create a new directory on the FTP server.Syntaxftp_mkdir(con,dir);Parameterscon − The FTP connectiondir − The name of the directory to be createdReturnThe ftp_mkdir() function returns name of the directory on success, or FALSE on failureExampleThe following is an example that creates a new directory −

ftp_mdtm() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

122 Views

The ftp_mdtm() function returns the last modified time of a specified file in PHP.Syntaxftp_mdtm(con,file);Parameterscon − The FTP connectionmyfile − The file to checkReturnThe ftp_mdtm() function returns the last modified time as a Unix timestamp.ExampleThe following is an example −

ftp_login() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

66 Views

The ftp_login() function allows you to log in to the FTP connection.Syntaxftp_login(con,user_name,password);Parameterscon − The FTP connectionuser_name − The user name to log inpassword − The password to loginReturnThe ftp_login() function returns TRUE on success or FALSE and warning on failure.ExampleThe following is an example −

ftp_get() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

222 Views

The ftp_get() function is used to downloads file from the FTP server and save it into a local file.Syntaxftp_fget(con,local_file,server_file,mode,startpos);Parameterscon − The FTP connectionlocal_file − A file where the data is storedserver_file − The server file to downloadmode − The transfer modestartpos − The position to begin downloading from. Added in PHP 4.3.0.ReturnThe ftp_fget() function returns TRUE on success and FALSE on failure.ExampleThe following is an example wherein we will download server file “demo.txt” and save it to local file “new.txt” −

ftp_get_option() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

59 Views

The ftp_get_option() function returns runtime options of the FTP connection.Syntaxftp_get_option(con,option);Parameterscon − The FTP connection.option − The runtime option to return.The following are the possible values −FTP_TIMEOUT_SEC - The timeout used for network operationsFTP_AUTOSEEK - Returns TRUE if this option is on, FALSE otherwiseReturnThe ftp_get_option() function returns the value on success, or FALSE if the given option is not supported.ExampleThe following is an example −

ftp_fput() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

75 Views

The ftp_fget() function is used to upload from an open file and saves it to a file on the FTP server.Syntaxftp_fput(con,remote_file,open_file,mode,startpos);Parameterscon − The FTP connectionremote_file − The file path to upload toopen_file − The open local filemode − The transfer modestartpos − The position to begin downloading fromReturnThe ftp_fget() function returns TRUE on success and FALSE on failure.ExampleThe following is an example wherein we will download server file “demo.txt” and save it to open local file “new.txt” −

ftp_fget() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

178 Views

The ftp_fget() function is used to downloads file from the FTP server and save it into an open local fileSyntaxftp_fget(con,open_file,server_file,mode,startpos);Parameterscon − The FTP connectionopen_file − A file where the data is storedserver_file − The server file to downloadmode − The transfer modestartpos − The position to begin downloading from. Added in PHP 4.3.0.ReturnThe ftp_fget() function returns TRUE on success and FALSE on failure.ExampleThe following is an example wherein we will download server file “demo.txt” and save it to open local file “new.txt” −

ftp_exec() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

165 Views

The ftp_exec() function is used to execute a command on the FTP server.Syntaxftp_exec(con, command)Parameterscon − The FTP connectioncommand − The command to execute.ReturnThe ftp_exec() function returns TRUE if the command was executed successfully, else FALSE.ExampleThe following is an example that executes a command on the FTP server −

ftp_delete() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

79 Views

The ftp_delete() function is used to delete a file on the FTP server.Syntaxftp_delete(con,myfile);Parameterscon − The FTP connectionmyfile − The file to be deletedReturnThe ftp_delete() function returns TRUE on success or FALSE on failureExampleThe following is an example to delete a file −

ftp_connect() function in PHP

Samual Sam
Updated on 30-Jul-2019 22:30:24

354 Views

The ftp_connect() function opens an FTB connection.Syntaxftp_connect(host,port,timeout);Parametershost − The FTP server to connect toport − The port of the FTP server. The default is 21. The host can be a domain or IP address.timeout − The timeout for network operationReturnThe ftp_connect() function returns an FTP stream on success or FALSE on errorExampleThe following is an example: to open an FTP connection, to work in it and closing it.

Advertisements