Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/08/2013, 07:34
fedembuj_89
 
Fecha de Ingreso: agosto-2013
Mensajes: 28
Antigüedad: 10 años, 9 meses
Puntos: 0
Respuesta: subir archivo servidor FTP

Ya encontre la solución, si alguien la quiere dejo el codigo

imagen.php

Cita:
<!DOCTYPE html>
<html>
<head>



</head>

<body>


<form action="subir.php" method="POST" enctype="multipart/form-data">
<input name="archivo_1" type="file">
<input type="Submit" name="Submit" value="Subir Archivo">
</form>


</body>
</html>
subir.php

Cita:


<?php
$FTP_User = "";
$FTP_Pass = "";
$FTP_Host = "";
$FTP_Root = "/blog/images/";
if ($_POST['Submit'] != "") {
$Connect = @ftp_connect($FTP_Host);
ftp_login($Connect, $FTP_User, $FTP_Pass);
$nombre_archivo = $FTP_Root . $_FILES['archivo_1']['name'];
$Local_Resource = $_FILES['archivo_1']['tmp_name'];
if(ftp_put($Connect, $nombre_archivo, $Local_Resource, FTP_BINARY)) {
echo "SUBIDO";
}
else
{
echo"ERROR AL SUBIR";
}
}
?>