Welcome Guest, Not a member yet? Register   Sign In
very urgent ..plz attention for image upload
#11

[eluser]xwero[/eluser]
Code:
# loaders
    $this->load->library('validation');
    $this->load->library('email');
    $this->load->helper(array('form', 'url', 'array'));
    $config['upload_path'] = './uploads/'; // added
        $config['allowed_types'] = 'gif|jpg|png'; // added
        $config['max_size']    = '100'; // added
        $config['max_width']  = '1024'; // added
        $config['max_height']  = '768'; // added
    $this->load->library('upload',$config); // changed
    $this->upload->do_upload();
#12

[eluser]Bharani[/eluser]
STILL FILE NOT INSERTED..

HOW CAN I CHECK THE FILE INSERTING OR NOT..
LIKE ECHO STATMENT..


IS THERE ANY CHANGES WANTS TO MADE IN THE CONFIG...
#13

[eluser]xwero[/eluser]
use print_r($_FILES) to see if there are uploaded files
#14

[eluser]Bharani[/eluser]
ya echo the $_file() in the model..
even it display ..what i selected in the image file in the form...

but selected image url not storeinto table...

i am really angry with this error..
#15

[eluser]Bharani[/eluser]
hi dear i got small idea..
can tell how i do that...


$userfile contain array...

but database query not support the array..is it na...

then how can i assign single value..((that is path ))..to table field..
plz tell
#16

[eluser]Bharani[/eluser]
aned one more good rsult ..that is ..now image is going to the upload folder..
only one problem that is image url not stored into table...
#17

[eluser]xwero[/eluser]
The problem is with your database.

I see in your model you are using
Code:
$userfile = $this->input->post('userfile');
While the file is in the $_FILES global
You could do
Code:
// controller
$this->Form_model->add_participant($this->upload->data());
// model
function add_participant($upload) // changed
  {
    $YourName = $this->input->post('YourName');
    $email = $this->input->post('email');
    $comments = $this->input->post('comments');
    echo $YourName;
    $userfile = (isset($upload))?$upload['filename']:''; // changed
    echo "test".$userfile."<br>" ;
    $querytest =$this->db->query("INSERT INTO participants (id, YourName, email, comments, userfile) VALUES(NULL, '$YourName', '$email', '$comments', '$userfile')");
  echo $this->db->last_query(); // for debugging
  }
#18

[eluser]Bharani[/eluser]
got this error


A PHP Error was encountered

Severity: Notice

Message: Undefined index: filename

Filename: models/form_model.php

Line Number: 15





INSERT INTO participants (id, YourName, email, comments, userfile) VALUES(NULL, 'ganeshkumarsrinivasan', '[email protected]', 'tetstfsadf fsadfsadfs', '')loaded

this
#19

[eluser]xwero[/eluser]
i'm sorry it's file_name instead of filename. If you want another value from the upload array check the user guide upload page.
#20

[eluser]Bharani[/eluser]
yes i got it...


very very thank you ..

[email protected]....


send your mail id




Theme © iAndrew 2016 - Forum software by © MyBB