PHP ftp_alloc() Function

The ftp_alloc() function is used to allocate space for a file to be uploaded to the FTP server. This function was introduced in PHP 5.

Syntax:

ParameterDescriptionIs compulsory
ftp_streamThe link identifier of the FTP connection.compulsory
file_sizeThe number of bytes to allocate.compulsory
server_resA variable to store server response(textual representation).Optional

Returns

The ftp_alloc() function returns TRUE on success or FALSE on failure.

Important note: Many FTP servers do not support this command.

Example 1

Explanation

In the above example, by using ftp_alloc() function we allocate space for file in ftp server.

Example 2

Explanation

In the above example, by using ftp_alloc() function we allocate the space for file to be uploaded to the FTP server.


Next TopicPHP FTP




Latest Courses