I wrote a PHP program to upload file from a client to a server box, if I run my program on my server and upload a file everything work correct, but if i run my web program frm a diferent PC in my network it doesn't works, the window promt to browser a file is showing up . but when I execute my program or press the UPload botton it doesn't works, just I have beer reading about it and I understood that there ara a special steps that I should include in my program to handle a load file from a client..
anybody could advise me about how I should handle this kind of issue....
function SubirArchivo($archivo_local,$archivo_remoto) {
//Sube archivo de la maquina Cliente al Servidor (Comando PUT)
if (file_exists($archivo_local)) {
echo "The file $archivo_local exist\n";
}
else {
echo "The file $archivo_local does not exist\n";
}
//echo $archivo_local;
$dirname='/MABD/';
$connect = ftp_connect('10.1.2.235') or die("Can’t connect to server");
//ftp_pasv($connect,true);
$login_result = ftp_login($connect,'ESRIOSJ','ESRIOSJ')or die("Can’t login to server");
$archivo_R= $dirname . $archivo_remoto;
if ( ftp_put($connect,$archivo_R,$archivo_local,FTP_BINARY)) {
echo "successfully uploaded $archivo_R\n";
}else {
echo "there was a problem while uploading $archivo_R\n ";
}
;
//Sube un archivo al Servidor FTP en modo Binario
ftp_quit($connect); //Cierra la conexion FTP
}
<!--Formulario para elejir el archivo a subir -->
<div id="position" >
<form action="" method="POST" name="form_ftp" id="form_ftp" >
<p><font size="2" face="Verdana, Tahoma, Arial">
<input name="archivo" type="file" id="archivo" />
<input name="Submit" type="submit" value="Upload" />
</font> </p>
</form>
</div>