This document discusses secure file upload in PHP web applications. It begins by describing a naive file upload implementation that allows arbitrary files to be uploaded, including PHP scripts that could execute commands on the server. It then discusses various approaches to make file uploads more secure, such as verifying the content type, image file contents, and file extensions. However, it notes that an attacker can bypass these checks by manipulating the HTTP request. The document concludes by providing a reference implementation for a more secure file upload process.