Setting up to use the class


show more Setting up to use the class 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 ...

Setting up to use the class

If you worked through the earlier chapters of this course, you should be familiar with how to use the upload file class. This movie and the next one, are mainly for the benefits of those who've skipped straight to this chapter, or if you need to refresh your memory. To use the class, you need a web page with a form that contains a file input field. In my editing program, I've got open form.php and you can find a copy of this file in the exercise files for this movie. Let's take a quick look at what this file contains.

Above the doctype is a small PHP block, on line 2 max is set to 50 times 1024. 1,024 is the number of bytes in a kilobyte. So this'll be used to set the maximum size of an upload file to 50 kb. Obviously if you want it to be a different value say 100 or 150, all you need to do is to change the 50 and PHP will do the calculation for you. Line 3 result is an empty array.

This will be used to store the results of the upload. And those results will be displayed by the PHP bl...

Setting up to use the class
Video duration: 4m 11s 2h 50m Intermediate

Viewers:

Setting up to use the class 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 ...