图像无法上传到Web服务器

I am having some difficulty uploading an image to a folder on my web server. Here's my code:

HTML:

<form action="" method="POST" enctype="multipart/form-data">
    <input type="file" name="image">
    <input type="submit" value="Upload Image" name="upload">
</form>

PHP:

<?php
    if (isset($_POST["upload"])) {
        $name = $_FILES["image"]["name"];
        $type = $_FILES["image"]["type"];
        $size = $_FILES["image"]["size"];
        $temp = $_FILES["image"]["tmp_name"];
        $error = $_FILES["image"]["error"];
        $target_file = "/profiles/images/$name";
        move_uploaded_file($temp, $target_file);
    }
?>

I've tried echoing out the file name ($name), but it doesn't return anything at all. It's blank for some reason. This is when I try to upload an image. When I echo $target_file, I get this "/profiles/images/", the $name part is not included for some reason.

Check your max upload file size. If in the settings the size is smaller than the file you are trying to upload, nothing is send.

This is happens in those cases when we try to upload very heavy size image, Please try to check your maximum file size, and please for testing try to upload maximum 100kb size of pic through this code. Hope this will work.