为什么破碎的图像插入longblob

时间:2017-12-26 09:51:25

标签: image phpmyadmin byte

<?php
    include "config.php";
    $StyleName = $_POST['StyleName'];
    $Description = $_POST['Desc'];
    $image = $_FILES['image']['name'];

    $sql = "INSERT INTO viewcutlist (CutName,Description,Image)
        VALUES ('$StyleName','$Description','$image')";

    if ($conn->query($sql) == TRUE) {
        echo "New record created successfully";
    }
?>

我选择的图像高于500kb但插入的图像被破坏并将其大小减小为字节。

1 个答案:

答案 0 :(得分:0)

def

而不是使用$image=addslashes (file_get_contents($_FILES['image']['tmp_name'])); 并添加斜杠。