First check if the upload is actually succeeding:
if ($_FILES['imagefile']['error'] === UPLOAD_ERR_OK) {
if (!getimagesize(....)) {
...
}
} else {
die("Upload failed with error code {$_FILES['imagefile']['error']}");
}
The error constants are defined here. Never assume an upload succeeded. There's only one way for them to work, and a million ways for them to fail.
Given that getimagesize() is complaining about an empty file name, either:
a. the upload failed, the reason code for which will be in the ...['error'] attribute.
b. you're checking the wrong file field name. If you've got <input type="file" name="image" /> then you have to check $_FILES['image'][...].
c. for whatever reason, your web server is able to WRITE files to the temporary directory, but does not have READ permissions.