Managing Files

The final segment of this Web application will manage files of any type. These scripts will allow users to upload files from their computers, which will then be stored on the server. The concept behind managing file uploads—as well as the very, very important preparation steps—was discussed in Chapter 11, “Extended Topics.” This application will expand upon that basic demonstration by

  • Storing the file’s information in the database

  • Renaming the file

  • Providing a method of downloading the files

  • Placing the files outside of the Web root directory, for improved security

In order to use these scripts, you’ll need to do two things. First, create the uploads table (if you haven’t already), using this SQL command (Figure 12.21).

Figure 12.21. ...

Get PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.