Connect and Upload to FTP server with PHP

Posted 1 Comment

<?php $ftp_server = “ftp.domain.com”; /// or you can use ip address $ftp_conn = ftp_connect($ftp_server,”21″) or die(“Could not connect to $ftp_server”); $login = ftp_login($ftp_conn, “user”, “password”); $file = “t.html”; // upload file if (ftp_put($ftp_conn, “iman.txt”, $file, FTP_ASCII)) { echo “Successfully uploaded $file.”; } else { echo “Error uploading $file.”; } // close connection ftp_close($ftp_conn); FTP port […]