Planning the class's features


show more Planning the class's features provides you with in-depth training on Developer. Taught by David Powers as part of the Uploading Files Securely with PHP show less
please wait ...

Planning the class's features

In the previous chapter, we created a basic script to upload the single file. But it was far from perfect. Although there was a hidden form field to set the maximum size for an individual file, someone could easily create a form of their own to get around that restriction. No checks are made on the type of file being uploaded. If the files are stored in the public folder, this presents a security risk. There's no check on filenames. So they could contain spaces, causing problems on Linux servers or in URLs.

Also, files with the same name as an existing one, automatically overwrite the original. The basic script handles only one file at a time. And it would be difficult to reuse without adapting the same script each time you want to use it. To solve these shortcomings, we're going to create a custom class. A class is basically a collection of related variables and functions that are designed to work together to perform a specific task, in this case to upload files.

Variables defined inside the cla...

Planning the class's features
Video duration: 3m 15s 2h 50m Intermediate

Viewers:

Planning the class's features provides you with in-depth training on Developer. Taught by David Powers as part of the Uploading Files Securely with PHP

Subject:
Developer
Software:
PHP
Author:
please wait ...