⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

An error has occurred on uploading



Гэрэлт-Од Гоцбаяр
  • profile picture
  • Member

Posted 28 March 2013 - 08:43 AM

Please fix it for me. Its killing my life almost 2 days and I need fix it as soon as possible. Because its live now. Code was working my local Wampserver.

 

When choose upload image, its just stuck on 100% and spinning loader appear. After one or two minutes "An error has occurred on uploading" will appear. Assets, Uploads, Images, Thumbs folders has 777 permission.

 

public function news() {

        $this->grocery_crud->set_table('news');
        $this->grocery_crud->display_as('title', 'Гарчиг')->display_as('body', 'Контент')->display_as('title_en', 'Англи гарчиг')->display_as('body_en', 'Англи Контент')->display_as('featured', 'Томоор гаргах эсэх')->display_as('image', 'Зураг')->display_as('datetime', 'Огноо')->display_as('showenglish', 'Англи хэлэнд харуулах');
        $this->grocery_crud->required_fields('title', 'body', 'datetime', 'featured', 'image', 'showenglish');
        $this->grocery_crud->set_field_upload('image', 'assets/uploads/images');
        $this->grocery_crud->callback_after_upload(array($this, 'after_upload_pic'));
        $this->grocery_crud->field_type('featured', 'true_false');
        $this->grocery_crud->field_type('showenglish', 'true_false');
        $output = $this->grocery_crud->render();

        $this->_example_output($output);
    }

    public function after_upload_pic($uploader_response, $field_info, $files_to_upload) {

        $this->load->library('md_image');

        $file_uploaded = $field_info->upload_path . '/' . $uploader_response[0]->name;

        $data = getimagesize($file_uploaded);
        $source_width = $data[0];
        $source_height = $data[1];

        $this->md_image->crop_to_ratio($file_uploaded, $source_width, $source_height, '620px', '250px', 'assets/uploads/images/featured/');
        $this->md_image->resize_image($file_uploaded, '140px', '85px', 'assets/uploads/images/thumbs/');
    }

 

 


victor
  • profile picture
  • Member

Posted 29 March 2013 - 07:55 AM

give me access


Гэрэлт-Од Гоцбаяр
  • profile picture
  • Member

Posted 29 March 2013 - 08:58 AM

Can we talk by gmail, yahoo or skype?


victor
  • profile picture
  • Member

Posted 29 March 2013 - 08:58 AM

skype -  ipgolovko


Alvin Firdaus
  • profile picture
  • Member

Posted 01 May 2013 - 14:52 PM

I get same problem, can you help me to fix this probelm?

I success upload in localhost but error in server hosting.. Please help.... :(


Alvin Firdaus
  • profile picture
  • Member

Posted 01 May 2013 - 14:57 PM

When i check in upload folder, i found that images but upload report is "An error has occurred on uploading".

Sorry with my bad english.


victor
  • profile picture
  • Member

Posted 01 May 2013 - 15:06 PM

Hi Alvin and welcome to the forum.
Which notice do you get in console?
And show your code.

Alvin Firdaus
  • profile picture
  • Member

Posted 01 May 2013 - 15:13 PM

my code :
        $crud = new grocery_CRUD();

        $crud->set_table('tbl_link');
        $crud->set_subject('Link');
        $crud->required_fields('label','link','images');
        $crud->set_field_upload('images','asset/dataweb');
        $crud->field_type('id_link', 'hidden');
        
        $output = $crud->render();
      

 

notice -> "An error has occurred on uploading"
please help me... :(


Alvin Firdaus
  • profile picture
  • Member

Posted 01 May 2013 - 15:30 PM

I try to upload, but i get this notice.

capture.png
 


victor
  • profile picture
  • Member

Posted 01 May 2013 - 15:37 PM

do you use debug panel (in browser) for debugging?


Alvin Firdaus
  • profile picture
  • Member

Posted 01 May 2013 - 15:44 PM

No, I dont
what is function?
what's my wrong code?
I think my problem same with
Гэрэлт-Од Гоцбаяр.
Can you fix it, Mr. victor?


victor
  • profile picture
  • Member

Posted 01 May 2013 - 16:18 PM

https://developers.google.com/chrome-developer-tools/


victor
  • profile picture
  • Member

Posted 01 May 2013 - 16:21 PM

you can look at server response using that panel.
If your project is on production server I can take a look at your project

victor
  • profile picture
  • Member

Posted 01 May 2013 - 16:24 PM

you can use CI log functionality too


victor
  • profile picture
  • Member

Posted 01 May 2013 - 16:27 PM

Гэрэлт-Од Гоцбаяр had a bug in php code

Alvin Firdaus
  • profile picture
  • Member

Posted 02 May 2013 - 05:34 AM

I found my mistake, error code if only i add $this->load->model('Webadmin_model');

 

failed upload

 function __construct()
    {
        parent::__construct();
        
        $this->load->database();
        $this->load->helper('url');
        
        $this->load->library('grocery_CRUD');  
        $this->load->model('Webadmin_model');
    }

 

Success upload

 function __construct()
    {
        parent::__construct();
        
        $this->load->database();
        $this->load->helper('url');
        
        $this->load->library('grocery_CRUD');    
    }

 

But, i need "$this->load->model('Webadmin_model');" for another function, so what should i do for fix it?


victor
  • profile picture
  • Member

Posted 02 May 2013 - 06:38 AM

what error do you get?

Carlos
  • profile picture
  • Member

Posted 30 May 2013 - 07:03 AM

Hello, I need you help my please!!! i get this notice "

 

"An error has ocurred on uploading"

 

 

In the browser Chrome Console:

 

  1. POST http://localhost/intranet/administrador/imagenes/add_imagenes/upload_file/url 500 (Internal Server Error)
  2. jquery-1.8.2.min.js:2

 

"


victor
  • profile picture
  • Member

Posted 30 May 2013 - 07:30 AM

type this in the index.php 

 

ini_set('display_errors',"On");


Carlos
  • profile picture
  • Member

Posted 04 June 2013 - 07:34 AM

Hi Victor, I get this error:

 

{"success":true,"files":[]}

 

In the database field is of type varchar 250 is okay?

 

In the firebug:

 

  1. POST http://localhost/intranet/administrador/imagenes/add_imagenes/upload_file/url 500 (Internal Server Error) jquery-1.8.2.min.js:2

error.jpg