Found 34490 Articles for Programming

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

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

ftp_close() function in PHP

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

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

ftp_chmod() function in PHP

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

72 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

ftp_chdir() function in PHP

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

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

ftp_cdup() function in PHP

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

84 Views

The ftp_cdup() function changes the current directory to the parent directory.Syntaxftp_cdup(con);Parameterscon − The FTP connectionReturnThe ftp_cdup() function returns TRUE on success or FALSE on failure.ExampleThe following is an example wherein we are updating the current directory to parent directory −

ftp_alloc() function in PHP

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

85 Views

The ftp_alloc() function allocates space for a file to be uploaded to the FTP server.Syntaxftp_alloc(connection,size_of_file,res);Parametersconnection − The FTP connection to usesize_of_file − The number of bytes to allocateres − A variable to store the server responseReturnThe ftp_alloc() function returns TRUE on success or FALSE on failureExampleThe following is an example −

header() function in PHP

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

336 Views

The header() function sends a raw HTTP header to a client.Syntaxheader(string,replace,resp_code)Parametersstring − The header string to send.replace − Indicates whether the header should replace previous or add a second header.resp_code − It forces the HTTP response code to the specified valueReturnThe header() function returns nothing.ExampleThe following is an example to save a generated PDF −

Advertisements