View difference between Paste ID: TyWeWa2d and 1mkXMFE0
SHOW: | | - or go back to the newest paste.
1
public $config = array(
2-
    "upload_path" => "uploads",
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
  }