Various web applications, such as blogs, forums and photo galleries allow users to upload files. Providing file upload function without opening security holes proved to be quite a challenge in PHP web applications. The article describes various security holes occurring in file upload implementations and provides an example secure implementation.