Changing the class's defaults


show more Changing the class's defaults 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 ...

Changing the class's defaults

The public methods of the upload file class have been designed to make it simple to change most defaults. But you might want to change some of them permanently, also the list of permitted Mime types and of potentially risky file name extensions, have been hardcoded into the class definition. To make changes, open uploadfile.php. And most of the defaults can be changed in the property declarations at the top of the class definition. First one that you might want to change is this one here, maxSize.

This sets the maximum limit for individual files that can be uploaded. It's expressed in bytes, and is currently set to 50 kilobytes. It's important to note that the value of max size must be an integer. You can't use calculation. So for example, if you want to change this to 150 kilobytes, and you try to do this, 150 times 1024, you'll see that I get a little underline here, and a message here saying that I've got a syntax error.

You can't have a calculation, it must be a fixed value....

Changing the class's defaults
Video duration: 5m 38s 2h 50m Intermediate

Viewers:

Changing the class's defaults 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 ...