Handling File Uploads
Apress eBooks · 2007
While most people tend to equate the Web with Web pages only, HTTP actually facilitates the transfer of any kind of file, such as Microsoft Office documents, PDFs, executables, MPEGs, zip files, and a wide range of other file types. Although FTP historically has been the standard means for uploading files to a server, such file transfers are becoming increasingly prevalent via a Web-based interface. In this chapter, you’ll learn all about PHP’s file-upload handling capabilities, in particular, the following: PHP’s file-upload configuration directives PHP’s $_FILES superglobal array, used to handle file-upload data PHP’s built-in file-upload functions: is_uploaded_file() andmove_uploaded_file() A review of possible error messages returned from an upload script An overview of the HTTPJJpload PEAR package