CODE
print_r($_FILES['userfile']);
in my PHP script returns
CODE
[tmp_name] => C:\Windows\Temp\phpCD38.tmp
[error] => 0
[size] => 0
[error] => 0
[size] => 0
Now, according to http://php.net/manual/en/features.file-upl...post-method.php
QUOTE
If no file is selected for upload in your form, PHP will return $_FILES['userfile']['size'] as 0, and $_FILES['userfile']['tmp_name'] as none.
Yet I get a temp name, and the error code 0 (=no error) where I would've expected error 4 (=no file was uploaded). So is something uploaded after all?
How should I best detect invalid file paths, so I can give the user an appropriate warning message? Currently I'm checking that the "uploaded" file is larger than 0 kB, but is there a more direct way?
