It’s a little bug but it confused me for a while.
I got the message : Unable to find a post variable called userfile.
The error was that i didn’t add the enctype=“multipart/form-data” but i was looking in the post array and there was the userfile present.
Maybe the error message could be changed to : Unable to find a files variable called userfile. Which is also more accurate.