Question: Hi Hi trying to upload a file via a form move it to another folder and then print its name. But doesnt work don't know why.

```
<form method="post" action='exercice.php' id="form1">
        <input type="file" name="files" id="files" onChange="submitForm();">            
</form>
<?php

if (isset($_FILES['files']))
{

    move_uploaded_file($_FILES['files']['tmp_name'], "uploaded/");
    echo $_FILES['files']['name'];
}

?>

```

Answer: 
form missing:

```
 enctype="multipart/form-data"

```

ref:
[spec](http://www.w3.org/TR/html401/interact/forms.html)
```
<form method="post" action='exercice.php' id="form1">
        <input type="file" name="files" id="files" onChange="submitForm();">            
</form>
<?php

if (isset($_FILES['files']))
{

    move_uploaded_file($_FILES['files']['tmp_name'], "uploaded/".$_FILES['files']['name']);
    echo $_FILES['files']['name'];
}

?>

```

You need to include the file name in the upload path, like shown above.

Also, where is your upload (ajax) code?
Did `isset($_FILES['files'])` return true?