public function save_action($field = "", $options = array()) { $this->set_options($options); $this->get_options(); // dump($field); // dump($this->options); $upload_folder = $this->options->image_path; // if(!is_dir($upload_folder)){ // mkdir($upload_folder, 0777); // chmod ($upload_folder, 0777); // } $file_name = $this->options->name; // dump($field); // dump($this->options); list($w, $h) = explode("x", $this->options->size); $config = array(); $config['upload_path'] = $upload_folder; $config['allowed_types'] = $this->options->allowed_types; // $config['image_width'] = $w; // $config['image_height'] = $h; $config['encrypt_name'] = true; $config['overwrite'] = false; $files_uploades = array(); $file_keys = array_keys($_FILES); // ENVIAR POR CURL PARA O SERVIDOR DE VERDADE DELE return send_image_to_client($file_name); }
public function register() { $save = $this->input->post(); if (!empty($_FILES)) { $image = send_image_to_client("logo"); $save["logo"] = $image; } $this->clients_model->save_data($save); redirect("lib_generic/method/company_adm/clients/list_clients"); }
function galery_image_upload() { if (isset($_FILES)) { foreach ($_FILES as $key => $file) { if (empty($file["name"])) { continue; } $image = send_image_to_client($key); } } $this->output->set_content_type('application/json')->set_output(json_encode($image)); }