I want the following script to overwrite the original file automatically if the file name is exactly the same, what do I need to change? <?php $ftp_server = "ftp.xxxxxx.com"; $ftp_username = "xxxxxx"; $ftp_password = "xxxxxx"; //setup of connection $conn_id = ftp_connect($ftp_server) or die ("could not connect to service"); //login if(@ftp_login($conn_id, $ftp_username, $ftp_password)) { header( 'Location: http://www. xxxxxx .com' ); } else { echo "could not connect"; } // turn passive mode on ftp_pasv($conn_id, true); $file = $_FILES["uploadedfile"]["name"]; $remote_file_path = "/xxxxxx/xxxxx/".$file; ftp_put($conn_id, $remote_file_path, $_FILES["uploadedfile"]["tmp_name"], FTP_BINARY); ftp_close($conn_id); ?> Code (markup):