ftp_alloc

It allocates space for a file to be uploaded

Example

<?php

$fName = “/home/user/test.txt”;

$ftpId = ftp_connect(‘ftp.phpcodez.com’);

$login_result = ftp_login($ftpId, ‘anonymous’, ‘user@phpcodez.com’);

ftp_alloc($ftpId, filesize($fName), $result) or die($result);

ftp_put($ftpId, ‘temfileName’, $file, FTP_BINARY);

ftp_close($ftpId);

?>