Advertisement
jamboljack

Upload PDF

Jan 25th, 2019
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. $jam                     = time();
  2.         $propose_id              = $this->input->post('id', 'true');
  3.         $username                = $this->input->post('username', 'true');
  4.         $config['file_name']     = 'Proposal_' . $propose_id . '_' . $username . '_' . $jam . '.pdf';
  5.         $config['upload_path']   = './upload_file/proposal/';
  6.         $config['allowed_types'] = 'pdf';
  7.         $config['overwrite']     = true;
  8.         $config['max_size']      = 0;
  9.         $this->load->library('upload');
  10.         $this->upload->initialize($config);
  11.  
  12.         if (!$this->upload->do_upload('file_pdf')) {
  13.             $response['status'] = 'error';
  14.         } else {
  15.             $this->hasil_m->upload_data();
  16.             $response['status'] = 'success';
  17.         }
  18.  
  19.         echo json_encode($response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement