Guys, I have 2 physical server, i was able to make a script that uploads the file using move_uploaded_file. Guys any idea on how i can transfer that uploaded file to another physical server using php. Thanks, Mike
PHP has a built-in function that can handle ftp: http://php.net/ftp You can also do it with curl. There's at least one example here: http://curl.haxx.se/libcurl/php/examples/ftpupload.html
Hi Jestep, i try to test one using the FTP. Any ideas with this error Warning: ftp_login() [function.ftp-login]: You will be disconnected after 15 minutes of inactivity. in /home/adminga/public_html/videos_add_save.php on line 103 102 $ftp_conn_id=ftp_connect($ftp_server); 103 $login_result=ftp_login($ftp_conn_id, $ftp_user_name, $ftp_user_pass); Thanks, Mike
I think it is just a response from the other server. The ftp service on the server you are connecting to can' distinguish between a php ftp connection or a dreamweaver ftp connection so it sends the same response. I would set your php error level at E_ERROR and not at E_WARNING. That warning is more for people using an FTP client to connect. At the top of the page you can just use this: error_reporting(E_ERROR); or error_reporting(0); if you don't want any errors.
Umm no? Not to be an ass, but a ftp connection is an ftp connection no matter what starts it. Here's an example taken from php.net <?php // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream ftp_close($conn_id); ?> Code (markup):