Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public $config = array(
  2.     "upload_path" => "./uploads/",
  3.     "allowed_types" => "gif|jpg|png",
  4.     "max_size" => 100,
  5.     "max_width" => 1024,
  6.     "max_height" => 768,
  7.     "encrypt_name" => TRUE
  8.   );
  9.  
  10. public function __construct()
  11. {
  12.     $this->load->library("upload", $this->config);
  13. }
  14.  
  15. public function store()
  16. {
  17.     // este é só o trecho onde o erro acontece...
  18.     if (!$this->do_upload()) {
  19.       $this->session->set_flashdata("error", $this->upload->display_errors());
  20.       redirect("events/create");
  21.     }
  22. }
  23.  
  24. public function do_upload()
  25.   {
  26.     if (!$this->upload->do_upload("cover")) {
  27.       return FALSE;
  28.     }
  29.     return $this->upload->data("file_name");
  30.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement