CodeIgniter Forums
codeigniter3 file uploading not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: codeigniter3 file uploading not working (/showthread.php?tid=66504)

Pages: 1 2


codeigniter3 file uploading not working - ijas - 10-27-2016

I have facing a problem on codeigniter3 file upload. getting following response 

"is currently unable to handle this request.

HTTP ERROR 500"


Not getting any errors.  but validation working fine.
anybody can  suggest me a solution fr this. Thank you.
following are my code
$this->load->helper('url');

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

$this->load->model('Video_model');



if($this->input->post('submit')){

$upload_path = './upload/';

           $config['upload_path'] = $upload_path;

           //allowed file types. * means all types

           $config['allowed_types'] = 'wmv|mp4|avi|mov';

           //allowed max file size. 0 means unlimited file size

           $config['max_size'] = '50000';

           //max file name size

           $config['max_filename'] = '255';

           //whether file name should be encrypted or not

           $config['encrypt_name'] = true;

           //store video info once uploaded

           $video_data = array();

           //check for errors

           $is_file_error = FALSE;

           if (!$_FILES) {

               $is_file_error = TRUE;

               $this->handle_error('Select a video file.');

           }



         

if (!$is_file_error) {



               //load the preferences

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

             

               //check file successfully uploaded. 'video_name' is the name of the input

               if (!$this->upload->do_upload('userfile')) {

                   //if file upload failed then catch the errors

                   $this->handle_error($this->upload->display_errors());

                   $is_file_error = TRUE;

               } else {

                   //store the video file info

                   $video_data = $this->upload->data();

                   

                  

                  $this->save_video($video_data['file_name']);

               }
       }





RE: codeigniter3 file uploading not working - InsiteFX - 10-27-2016

Usually HTTP ERROR 500 is a server error but can in rare case be a programming error.

Check your php.ini file:

php.ini file.

post_max_size = 10M and upload_max_filesize = 10M should be set to the same value and the size that you need to upload.

Your server memory setting can also effect this memory_limit = 64M

Set to what your needs are.


RE: codeigniter3 file uploading not working - ijas - 10-28-2016

(10-27-2016, 11:02 AM)InsiteFX Wrote: Usually HTTP ERROR 500 is a server error but can in rare case be a programming error.

Check your php.ini file:

php.ini file.

post_max_size = 10M and upload_max_filesize = 10M should be set to the same value and the size that you need to upload.

Your server memory setting can also effect this memory_limit = 64M

Set to what your needs are.

In localhost , its wrking fine. facing problem on live server.  or else, any problem with PHP Version. live server PHP Version is 5.4.32


RE: codeigniter3 file uploading not working - ijas - 10-28-2016

Its working fine on localhost. facing issue in live server.


RE: codeigniter3 file uploading not working - karthik_code - 10-28-2016

I am also having the same problem.
php.ini file not an issue.


RE: codeigniter3 file uploading not working - karthik_code - 10-28-2016

The issue is only after upgrading to CI core to 3.1.1.
File upload works fine up to CI 3.1.0


RE: codeigniter3 file uploading not working - ijas - 10-28-2016

(10-28-2016, 05:40 AM)karthik_code Wrote: The issue is only after upgrading to CI core to 3.1.1.
File upload works fine up to CI 3.1.0

Can you send me the 3.1.0


RE: codeigniter3 file uploading not working - karthik_code - 10-28-2016

(10-28-2016, 07:18 AM)ijas Wrote:
(10-28-2016, 05:40 AM)karthik_code Wrote: The issue is only after upgrading to CI core to 3.1.1.
File upload works fine up to CI 3.1.0

Can you send me the 3.1.0

You can download from Github https://github.com/bcit-ci/CodeIgniter/releases


RE: codeigniter3 file uploading not working - ijas - 10-28-2016

(10-28-2016, 09:02 AM)karthik_code Wrote:
(10-28-2016, 07:18 AM)ijas Wrote:
(10-28-2016, 05:40 AM)karthik_code Wrote: The issue is only after upgrading to CI core to 3.1.1.
File upload works fine up to CI 3.1.0

Can you send me the 3.1.0

You can download from Github https://github.com/bcit-ci/CodeIgniter/releases

Yeh, i got it. It's working fine now Smile. Thnks buddy


RE: codeigniter3 file uploading not working - ijas - 10-28-2016

It was version issue(3.1.1).   replaced it with 3.1.0. now its working fine. Thanks for all your support.  Heart