Welcome Guest, Not a member yet? Register   Sign In
codeigniter3 file uploading not working
#1

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']);

               }
       }


Reply
#2

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(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
Reply
#4

Its working fine on localhost. facing issue in live server.
Reply
#5

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

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

(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
Reply
#8

(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
Reply
#9

(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
Reply
#10

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




Theme © iAndrew 2016 - Forum software by © MyBB