HELP !! Problems when trying to copy a file by ftp, from an apache with xampp to an AS400 server

0
introducir el código aquí

if (isset ($ _ POST ['send'])) {

$fileTemp = $_FILES['file']['tmp_name'];
$fileName = $_FILES['file']['name'];
$fileSize = $_FILES['file']['size'];
$fileType = $_FILES['file']['type'];



if ($fileSize > 1000000) {

    $_SESSION['error'] = "El tamaño del archivo no debe ser mayor a 1 MB. ";

    header('Location: ../vista/form.php');


}

if ( $fileType != "image/jpeg" ) {

    $_SESSION['error'] = "El archivo a subir debe estar en formato JPG.";

    header('Location: ../vista/form.php');

}

if (empty($_POST['cta'])) {

    $_SESSION['error'] = "Debe seleccionar un tipo de cuenta.";

    header('Location: ../vista/form.php');
}

//qibm/UserData/WebSphere/AppServer/V7/Express/profiles/WAS70SVR/sbi/sbi.ear/sbi.war/FirmasAH

$servidor = ftp_connect("xx.xx.xx.xx");
$usuarioFtp = ftp_login($servidor, "nbrusquett","xxxx");

if ((!$servidor) || (!$usuarioFtp)) {

    $_SESSION['error'] = "Error en la conexión. "; die;

    header('Location: ../vista/form.php');
} 


    ftp_pasv ($servidor, true);

ftp_chdir($servidor, "/qibm/UserData/WebSphere/AppServer/V7/Express/profiles/WAS70SVR/sbi/sbi.ear/sbi.war/FirmasAH/");

$ruta = "/qibm/UserData/WebSphere/AppServer/V7/Express/profiles/WAS70SVR/sbi/sbi.ear/sbi.war/FirmasAH/".$fileName;

    if (is_uploaded_file($fileTemp)){

        if (move_uploaded_file($fileTemp, $ruta)) {

            $_SESSION['error'] = "Registro de firma cargado correctamente.";

            header('Location: ../vista/form.php');      

        };



    }

    else {

        $_SESSION['error'] = "No se pudo copiar el archivo.";

        header('Location: ../vista/form.php');

    }

    ftp_close($servidor);

}

? > Do you have any idea what could be wrong? The error I have is:

Warning: move_uploaded_file (/qibm/UserData/WebSphere/AppServer/V7/Express/profiles/WAS70SVR/sbi/sbi.ear/sbi.war/FirmasAH/nbrusquett.JPG): failed to open stream: No such file or directory in C: \ xampp \ htdocs \ LoadFirmRecord \ driver \ cargaFirma.php on line 58 Warning: move_uploaded_file (): Unable to move 'C: \ xampp \ tmp \ php7957.tmp' to '/qibm/UserData/WebSphere/AppServer/V7/Express/profiles/WAS70SVR/sbi/sbi.ear/sbi.war/ SignaturesAH / nbrusquett.JPG 'in C: \ xampp \ htdocs \ UploadFirmRecord \ driver \ uploadFirm.php on line 58

    
asked by nbrusquetti 17.02.2017 в 02:23
source

1 answer

0

You must find out the route where the server temporarily saves the files you can from the php.ini or with phpinfo () and replace it with the one you have on it that seems to be wrong.

    
answered by 17.02.2017 в 03:26