OK.
But I need to check it before upload.
So I have tried with this
$image = getimagesize($_FILES['upload']);
where upload is the name of the input form
<input name="upload" type="file">
The form works, and I can upload the photo. I can also check the type with this line:
$filetype = $_FILES['upload']['type'];
So it's only the getimagesize that doesn't work.