 
            if(Sentry::check())
  {
   if (Input::method() == 'POST'){
    $config = array(
     'path' => DOCROOT.DS.'assets/img/front/users/temp',
     'max_size' => 51200,
     'randomize' => true,
     'ext_whitelist' => array('img', 'jpg', 'jpeg', 'gif', 'png'),
    );
    Upload::process($config);
    if (Upload::is_valid())
    {
     Upload::save();
    
     $user = Model_Users::find_by_id(Sentry::user()->get('id'));
     $user->picture = Upload::get_files(0)->name;
     $user->save();
    }
    // and process any errors
    foreach (Upload::get_errors() as $file)
    {
     Session::set_flash('error', 'Invalid file!');
     Response::redirect('/users/settings');
    }
    Session::set_flash('success', 'Profile picture changed!');
    Response::redirect('/users/settings');
   }
   $this->template->title = "Settings";
   $this->template->content = View::forge('users/settings');
  } else {
   Log::warning('Following person did not have authorisation - ('.$_SERVER['REMOTE_ADDR'].')');
   Session::set_flash('error', 'Access restricted!');
   Response::redirect('/');
  }
Upload::get_files(0)->name;
It looks like you're new here. If you want to get involved, click one of these buttons!