Welcome Guest, Not a member yet? Register   Sign In
File (Image) Upload
#1

[eluser]KrYpToNiT3[/eluser]
See my Code,

Code:
$docidn = $this->input->post('doc_identity'); //reference to the private function
    $docres = $this->input->post('doc_residence'); //reference to the private function
    if($docidn != "")
     $doc_idn = $this->upload_docs_idn();
    else
     $doc_idn = NULL;
    if($docres != '')
     $doc_res = $this->upload_docs_res();
    else
     $doc_res = NULL;

The functions

Code:
private function upload_docs_idn(){
/**
  * Upload the necessary Documents (Identity)
  * returns the full path of the file_location
  **/
  $config['upload_path'] = 'http://localhost/direct/uploads/docs_identity';
  $config['allowed_types'] = 'gif|jpg|png';
  $config['max_size'] = '2048';
  $config['encrypt_name'] = TRUE;

  $this->load->library('upload', $config);
  
  $this->upload->do_upload('doc_identity');
  $data = $this->upload->data();
  return $data['full_path'];
}

private function upload_docs_res(){
/**
  * Upload the necessary Documents (Proof of Residence)
  * returns the full path of the file_location
  **/
  $config['upload_path'] = 'http://localhost/direct/uploads/docs_residence';
  $config['allowed_types'] = 'gif|jpg|png';
  $config['max_size'] = '2048';
  $config['encrypt_name'] = TRUE;

  $this->load->library('upload', $config);
  $this->upload->do_upload('doc_residence');
  $data = $this->upload->data();
  return $data['full_path'];
}

$docidn is always NULL, even If I select a file :/ what could be the problem ???


Messages In This Thread
File (Image) Upload - by El Forum - 11-11-2012, 09:14 AM
File (Image) Upload - by El Forum - 11-11-2012, 08:15 PM
File (Image) Upload - by El Forum - 11-12-2012, 04:55 AM
File (Image) Upload - by El Forum - 11-14-2012, 05:15 AM
File (Image) Upload - by El Forum - 11-14-2012, 06:33 AM
File (Image) Upload - by El Forum - 11-14-2012, 07:25 AM
File (Image) Upload - by El Forum - 11-15-2012, 12:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB