I am using PHP to create a small script that uploads images to a server.
While going through the PHP documentation, I found a contribution from user CertaiN that gives a very clear example of how this script should look like: CertaiN's contribution. The code is, overall, very well explained, but the very first line of the script has no comment or explanation:
header('Content-Type: text/plain; charset=utf-8');
I browsed the internet and found no explanation for this command. My question is, therefore, the following: what is the exact purpose of this line in the protections against malicious uploads? Or is it completely unrelated to the rest of the script?