Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 2871 of 3366
114 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 −
183 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 −
132 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 −
392 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” −
143 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 −
178 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” −
270 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” −
242 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 −
164 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 −
458 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.