bober
Guest
PHP:
<?php
$ftp_server='myserver.com';
$ftp_user_name='myuser';
$ftp_user_pass='may_pasword';
$file = '/home/myuser/public_html/images/matrix.gif';
$remote_file = 'http://www.myserver.com/matrix.gif';
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
ftp_pasv($conn_id, true) or die("Could not set password");
ftp_put($conn_id, $remote_file, $file, FTP_ASCII) or die("Could not upload file");
ftp_close($conn_id);
?>