Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public $config = array(
- "upload_path" => "./uploads/",
- "allowed_types" => "gif|jpg|png",
- "max_size" => 100,
- "max_width" => 1024,
- "max_height" => 768,
- "encrypt_name" => TRUE
- );
- public function __construct()
- {
- $this->load->library("upload", $this->config);
- }
- public function store()
- {
- // este é só o trecho onde o erro acontece...
- if (!$this->do_upload()) {
- $this->session->set_flashdata("error", $this->upload->display_errors());
- redirect("events/create");
- }
- }
- public function do_upload()
- {
- if (!$this->upload->do_upload("cover")) {
- return FALSE;
- }
- return $this->upload->data("file_name");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement