
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 2872 of 3368

383 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” −

134 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 −

172 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” −

265 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” −

237 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 −

159 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 −

450 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.

116 Views
The ftp_close() function closes an FTP connection.Syntaxftp_close(con);Parameterscon − The connection to close.ReturnThe ftp_close() function returns TRUE on success or FALSE on failureExampleThe following is an example that login to a connection, works in it to change the directory and then connection is closed −

141 Views
The ftp_chmod() function set permissions on a remote file via FTP.Syntaxftp_chmod(con, mode, my_file);Parameterscon − The FTP connectionmode − The new permissions.It consists of four numbers −The first number is always zeroThe second number specifies permissions for the OWNERThe third number specifies permissions for the OWNER's USER GROUPThe fourth number specifies permissions for EVERYBODY ELSEPossible values (to set multiple permissions, add up the following numbers) −1 = execute permissions2 = write permissions4 = read permissionsmy_file − The File nameReturnThe ftp_chmod() function returns new file permissions on success or FALSE on error.ExampleThe following is an example to set file permission by changing ... Read More

191 Views
The ftp_chdir() function changes the current directory on the FTP server.Syntaxftp_chdir(con, dir)Parameterscon − The FTP connectiondir − The directory to change toReturnThe ftp_chdir() function returns TRUE on success or FALSE on failure.ExampleThe following is an example wherein the current directory is changed −