Reply to CodeIgniter Integration

CodeIgniter Integration new!
by Konstsntin, 13 years, 3 months ago
Hi,
CodeIgniter's native upload library doesn't allow to manipulate images as it is necessary. I have tried to connect a class to CodeIgniter, but have come to grief :-( Whether there is at somebody an experience of such integration?
1) I have remaned class.upload.php to My_upload.php and copied it into application/librires folder
2) try:
function __construct() {
  parent::__construct();
  $this->load->helper(array('form', 'url'));
  $this->load->library('my_upload');
}
function do_upload() {
  $now = date("YmdHis");
  $config['upload_path'] = './uploads/userpics/tmp/';
  $uploaded = $this->my_upload->upload($_FILES["userfile"]);
  if ( $uploaded ) {
    $this->my_upload->file_new_name_body   = 'image_resized' . $now;
    $this->my_upload->image_resize         = true;
    $this->my_upload->image_x              = 100;
    $this->my_upload->image_ratio_y        = true;
    $this->my_upload->process('./uploads/userpics/');
    if ( $this->my_upload->processed() ) {
      echo "OK";
      $this->my_upload->clean();  
    } else {
      echo "ERROR";
    }
  } 
  else echo "ERROR";    
}
But have only errors...Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important