Trying to add admin file upload form plugin

Turns out the code is correct, the problem is the tutorial site I copy/pasted from was using weird, non standard space characters instead of normal spaces. I replaced the “fake spaces” with “normal spaces” and now everything works.

In order to debug this I needed to look at the Apache error log rather than the WordPress error log. That eventually led me here: https://stackoverflow.com/questions/11493751/unexpected-t-string-in-if-clause-with-spaces