Upload with php - problem with charset

0

I have a problem that has been disturbing me for some time.

I have a page for simple image upload, the page is on charset utf-8 and the firebird database on iso8859-1. The reason for the system being in utf-8 is that all the plug-ins I use from third parties are in utf-8 and so I hit the accent on the project. My problem is: When I upload the system to, it literally crashes and does not move, I need to restart apache to go back to normal. Below the codes I use for uploading

html page:

        <form method="POST" action="./upload.php" id="Formulario" enctype="multipart/form-data">
        <input type="file" id="cbFoto" name="cbFoto">
        <input type="submit" id="btGravar" value="Gravar">
        </form>       

php page:

    $nome_foto1 = "./tmp/" . time() . ".jpg";
    if (move_uploaded_file($_FILES['cbFoto']['tmp_name'], $nome_foto1)) {

        $img = WideImage::load($nome_foto1);
        $img = $img->resize(521, 386, 'outside');

        $blob = $img->asString('jpg');

        unlink($nome_foto1);
    }

    try {

            $loginbd = "sysdba";
            $senhabd = "masterkey";

            $pdo = new PDO('firebird:dbname=192.168.1.101:/backup/base.fdb;charset=ISO8859_1', $loginbd, $senhabd);
            $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

            $stmt = $pdo->prepare('UPDATE COLABORADORES SET FOTO2 = ? WHERE SERIAL = ? ');

            $stmt->bindParam('1', $blob, PDO::PARAM_STR);
            $stmt->bindParam('2', $codigoColaborador, PDO::PARAM_STR);

            $stmt->execute();

            /* while ($linha = $stmt->fetch(PDO::FETCH_ASSOC)) {
              echo "Nome: {$linha['NOMECOMPLETO']}<br />";
              } */



        } catch (PDOException $e) {
            echo 'Error: ' . $e->getMessage();
        }

has meta charset="utf-8" at the top of the html and
page     header ("Content-Type: text / html; charset = UTF-8", true); on the php page.

I'm using wideimage to resize, if the uranium uploads a very large image, but doing it right through the field:

$_FILES['cbFoto']['tmp_name']

also hangs ....

Does anyone have a light?

    
asked by anonymous 28.11.2017 / 20:59

0 answers