• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload file with ajax framework

#1
Hallo,
I am using ajax framework in my project ( https://github.com/bcit-ci/CodeIgniter/w...odeIgniter )
I would like to upload an image from a form.

when i put this code in controller with name users image upload correct but i want to put my code in ajax controller in file response/users
my code to upload image.

$config['upload_path'] = './assets/images/avatars/' . $user_id ;
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '800';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$config['file_name'] = 'avatar.png';

$this->load->library('upload', $config);

if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());

}
else
{
$data = array('upload_data' => $this->upload->data());
}

Any help ???
Reply


Messages In This Thread
Upload file with ajax framework - by michalis - 06-19-2015, 04:16 AM
RE: Upload file with ajax framework - by PaulD - 06-22-2015, 06:00 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.