Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

File Transfer Protocol Secure (FTPS)

FTPS stands for File Transfer Protocol Secure. It is a protocol to transfer files between servers, over a secure connection.

PHP supports FTP and FTPS, through the ext/ftp extension, the ext/curl extension and the internal wrappers.

<?php
    $ftp = ftp_connect($ftpAddress); 
    
    $upload = ftp_put($ftp, $destinationPath, $sourceFile, FTP_BINARY); 
    
    if (!$upload) { 
        echo "FTPS upload has failed!";
    } else {
        echo "Uploaded $source_file to $ftp_server as $destination_file";
    }
    
    ftp_close($ftp);
?>

Documentation

See Also