Problems uploading a photo to php taking a photo

0

good night everyone. Thanks in advance to anyone who can help me. It turns out that I have a program that uploads images to a computer folder (wamp), that's fine. The problem occurs when selecting the input type="file" from the cell phone and taking a picture does not go up; with the images, but not with the photos taken. I do not know if it could be a problem with the file extension. Here the code:

HTML:

<div class="container">
    <form action="index.php?action=20" enctype="multipart/form-data" method="post" role='form'>
        Imagen:<br/>
        <input type="file" name="image" class="form-control" /><br/>

        Texto:<br/>
        <input type="text" name="text" class="form-control" /><br/><br/>

        <input type="submit" value="Upload" class="form-control btn btn-success"/>
    </form>
</div>

PHP:

case 20:
        $_SESSION["page"]=3;
        if ($_FILES['image']['error'] <= 0) {
            $result=mysql_query("SELECT * FROM elements ORDER BY id DESC");
            $data=mysql_fetch_array($result);
            $nom = "uploads/" . ($data['id']+1) . ".jpg";
            $resultat = copy($_FILES['image']['tmp_name'],$nom);
            $text = strtolower($_POST['text']);
            mysql_query("INSERT INTO elements VALUES (NULL, '$nom', '1', '$text');");

        }
        break;

By the way I saw that it could be of permission but the images of the cell phone goes up normal, the problem is to select the camera and take the photo.

    
asked by DianaDiana 22.05.2018 в 06:30
source

0 answers