Advertisement
GWibisono

just fix i

Feb 5th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. $file_name = underscore($_FILES['linkmanulas']['name']);
  2. $file_name = round(microtime(true)) .''. $file_name;
  3. $config = array(
  4. 'upload_path' => "./uploads/",
  5. 'allowed_types' => "gif|jpg|jpeg|png|iso|dmg|zip|rar|doc|docx|xls|xlsx|ppt|pptx|csv|ods|odt|odp|pdf|rtf|sxc|sxi|txt|exe|avi|mpeg|mp3|mp4|3gp",
  6. 'overwrite' => TRUE,
  7. 'max_size' => "2048000", // Can be set to particular file size , here it is 2 MB(2048 Kb)
  8. 'max_height' => "0",
  9. 'max_width' => "0",
  10. 'file_name' => $file_name
  11. );
  12.  
  13. //$this->load->library('upload', $config);
  14. if($this->upload->do_upload($file_name))
  15. {
  16. $data = array('upload_data' => $this->upload->data());
  17. //return ;
  18. print_r($data);
  19. exit;
  20. $this->load->view('admin/vwAddContent',$data);
  21. }
  22. else
  23. {
  24. $error = array('error' => $this->upload->display_errors());
  25. print_r($error);
  26. exit;
  27. $this->load->view('admin/vwAddContent', $error);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement