Skip to content
Advertisement

PHP 8.1 $_FILES missing type property

I am upgrading my website from PHP 7.4 to 8.1 which is causing an unusual issue with $_FILES. I’m trying to upload a new file but nothing happens. This issue cannot be regarding the file size as I’m trying to upload .txt files containing a single word.

Example of my code:

JavaScript

When the from is posted the data within $_FILES is like so

test={ name="test.txt, full_path=test.txt, type="", tmp_name="", error={int} 6, size={int} 0}

Advertisement

Answer

The PHP website did not have access to the “C:WINDOWSTemp” directory. Which was easily fixed by changing the security permissions.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement