Query: ftp_alloc
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FTP_ALLOC(3) 1 FTP_ALLOC(3) ftp_alloc - Allocates space for a file to be uploadedSYNOPSISbool ftp_alloc (resource $ftp_stream, int $filesize, [string &$result])DESCRIPTIONSends an ALLO command to the remote FTP server to allocate space for a file to be uploaded. Note Many FTP servers do not support this command. These servers may return a failure code ( FALSE) indicating the command is not sup- ported or a success code ( TRUE) to indicate that pre-allocation is not necessary and the client should continue as though the oper- ation were successful. Because of this, it may be best to reserve this function for servers which explicitly require preallocation.PARAMETERSo $ftp_stream - The link identifier of the FTP connection. o $filesize - The number of bytes to allocate. o $result - A textual representation of the servers response will be returned by reference in $result if a variable is provided.RETURN VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #1 ftp_alloc(3) example <?php $file = "/home/user/myfile"; // connect to the server $conn_id = ftp_connect('ftp.example.com'); $login_result = ftp_login($conn_id, 'anonymous', 'user@example.com'); if (ftp_alloc($conn_id, filesize($file), $result)) { echo "Space successfully allocated on server. Sending $file. "; ftp_put($conn_id, '/incomming/myfile', $file, FTP_BINARY); } else { echo "Unable to allocate space on server. Server said: $result "; } ftp_close($conn_id); ?>SEE ALSOftp_put(3), ftp_fput(3). PHP Documentation Group FTP_ALLOC(3)
Related Man Pages |
---|
ftp_nb_fput(3) - php |
ftp_chdir(3) - php |
ftp_get(3) - php |
ftp_nb_fget(3) - php |
ftp_pasv(3) - php |
Similar Topics in the Unix Linux Community |
---|
Password recovery |
How to make sure a file is uploaded in its entirety |
FTP not working under Linux but working under any other OS ??? Very strange |
Space Problem in Unix Server |
Brtools Help |