Javatpoint Logo
Javatpoint Logo

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:

Parameter Description Is compulsory
ftp_stream The link identifier of the FTP connection. compulsory
file_size The number of bytes to allocate. compulsory
server_res A 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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA