Welcome Guest, Not a member yet? Register   Sign In
File upload not working (no errors even displayed)
#1

[eluser]bhakti.thakkar[/eluser]
hi all,
i am trying to upload file but it isnt working. below in the code in MVC:
view.php
Code:
<?php echo form_open_multipart('ncs/do_upload/' . $row->NonConformity_ID, array('id'=>'private_note_form'));?>

        <h4>Upload evidence document(s) </h4>

        <p>
            &lt;input name="userfile" type="file" id="userfile" /&gt;
        </p>

        <p>
            &lt;input type="submit" name="submit" value="Add files" /&gt;  
        </p>

&lt;?php echo form_close();?&gt;


Code in the controller:
ncs.php:
Code:
function do_upload($id)
    {
        $this->load->model('evidence_upload_model');

        $directory="HTTP://".$_SERVER['SERVER_NAME']."/files/Appl_files/";
        $config['upload_path'] = $directory;
        $config['max_size']    = '16777215';
        $config['max_width']  = '3000';
        $config['max_height']  = '3000';
            
        $this->load->library('upload'); // load if it hasn't already been loaded
        $this->upload->initialize($config); // pass the settings to the library
        $data = array('upload_data' => $this->upload->data());
            print_r($config);
            
            if(!$this->upload->do_upload())
              {
                $error = array('error' => $this->upload->display_errors());

//                return FALSE;
            //    print "not done";
              }
              else
              {
                  print "done";
//                return TRUE;
              }
    

//        $this->session->set_flashdata('message', 'success in file upload');
//        redirect('ncs/view/' . $id);
    }

No error messages also displayed. files also not uplaoded in the specified path. just a blank page. i have checked the directory access also (CHMOD = 777)

Please help me
Thanks


Messages In This Thread
File upload not working (no errors even displayed) - by El Forum - 10-16-2008, 01:00 AM
File upload not working (no errors even displayed) - by El Forum - 10-16-2008, 03:07 AM
File upload not working (no errors even displayed) - by El Forum - 10-16-2008, 03:15 AM
File upload not working (no errors even displayed) - by El Forum - 10-22-2008, 01:44 PM
File upload not working (no errors even displayed) - by El Forum - 06-29-2010, 02:10 PM
File upload not working (no errors even displayed) - by El Forum - 06-29-2010, 02:22 PM
File upload not working (no errors even displayed) - by El Forum - 06-29-2010, 02:22 PM
File upload not working (no errors even displayed) - by El Forum - 06-29-2010, 02:52 PM
File upload not working (no errors even displayed) - by El Forum - 06-29-2010, 02:57 PM
File upload not working (no errors even displayed) - by El Forum - 06-29-2010, 03:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB