global variables for class.upload.php

See all posts See thread Reply

Re: global variables for class.upload.php new!
by colin, 10 years ago
You can do it with simple PHP (not tested):
$options = array(
  'auto_create_dir' => FALSE,
  'file_max_size' => '5000000', 
  'mime_check' => TRUE, 
  'allowed' => array('image/jpeg','image/gif','image/png'),
  'no_script' => true, #güvenlik
  'image_resize' => true,
  'image_ratio_crop' => true,
  'file_auto_rename' => true, 
  'file_name_body_pre' => 'tt_'
);

$handle = new Upload($_FILES['resim']);
if ($handle->uploaded) {
  // assign the array values to the class properties
  foreach ($options as $key => $value) {
    $handle->$key = $value;
  }
}
Reply