Tengo que realizar un ftp desde el cliente al servidor, se conecta perfecto y me autoriza bien el usuario y la contraseña falla al realizar el ftp. Me podrias decir cual es el error en el codigo? ftp_put($ftp_conn, "leyesII.htm" , "E:/doc/leyesII.htm", FTP_BINARY) Gracias
Para subir un archivo de tu disco duro al servidor tienes que hacer antes un formulario para mandar el archivo mendiente un campo input type=file a la pagina donde tendras el codigo de las funciones de ftp. Te mando un ejemplo: <html> <body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4 bgcolor=white vlink="#0000ff" link="#0000ff"> <form name="Attachments" method=POST action="sendimage.php" enctype="multipart/form-data"> <input type=hidden name=box value=""> <tr> <td nowrap width="1%"> <b>Image:</b></td> <td colspan=2> <input type=file name=source_file size=20> </td> </tr> <input type=submit name=btnSubmit value=Submit size=20 style="border: 1px solid #0000FF"></form> </body> </html> The critical point in this form is the usage of enctype="multipart/form-data" If you don't use this part your upload operations won't work. Then u must create sendimage.php as follows: <?php $ftp_server='190.148.20.201';//serverip $conn_id = ftp_connect($ftp_server); // login with username and password $user="username"; $passwd="*****"; $login_result = ftp_login($conn_id, $user, $passwd); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; die; } else { echo " Connected to $ftp_server, for user $user "; } //directorylike /www.velibaba.com/images ftp_chdir($conn_id, "www.velibab.com"); ftp_chdir($conn_id, "compimages"); //$destination_file=ftp_pwd($conn_id); $destination_file="x.jpg"; echo (" "); print $destination_file; echo (" "); // 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); ?>