6 UPLOADING FILES

What this chapter covers:

  • Understanding how PHP handles file uploads
  • Restricting the size and type of uploads
  • Preventing files from being overwritten
  • Organizing uploads into specific folders
  • Handling multiple uploads

PHP's ability to handle forms isn't restricted to text. It can also be used to upload files to a server. In theory, this opens up great possibilities. For instance, you could build a real estate website where clients could upload pictures of their properties, or a site for all your friends and relatives to upload their holiday photos. However, just because you can do it, doesn't necessarily mean that you should. Allowing others to upload material to your website could expose you to all sorts of problems. You ...

Get PHP Solutions: Dynamic Web Design Made Easy now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.