How to change class.upload name?

See all posts See thread Reply

Re: How to change class.upload name? new!
by colin, 15 years, 11 months ago
You should be able to rename the class as you wish.

Let's say that the class is named My_OSC_Upload. You would then instantiate the class as following:
$handle = new My_OSC_Upload($_FILES['form_field']);
$handle->process();
echo $handle->log;

One thing thought, don't forget to also rename the constructor of the class if you change its name. So you have to change in two places:
class upload {
and
function upload($file, $lang = 'en_GB') {
becomes
class My_OSC_Upload {
and
function My_OSC_Upload($file, $lang = 'en_GB') {
Reply