Search
 
SCRIPT & CODE EXAMPLE
 

PHP

ci3 upload file

<?php

class Upload extends CI_Controller {

        public function __construct()
        {
                parent::__construct();
                $this->load->helper(array('form', 'url'));
        }

        public function index()
        {
                $this->load->view('upload_form', array('error' => ' ' ));
        }

        public function do_upload()
        {
                $config['upload_path']          = './uploads/';
                $config['allowed_types']        = 'gif|jpg|png';
                $config['max_size']             = 100;
                $config['max_width']            = 1024;
                $config['max_height']           = 768;

                $this->load->library('upload', $config);

                if ( ! $this->upload->do_upload('userfile'))
                {
                        $error = array('error' => $this->upload->display_errors());

                        $this->load->view('upload_form', $error);
                }
                else
                {
                        $data = array('upload_data' => $this->upload->data());

                        $this->load->view('upload_success', $data);
                }
        }
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php debug telegram bot 
Php :: Internal error: xmlSchemaValidateChildElem, calling xmlRegExecPushString2(). 
Php :: Internal error: xmlSchemaDocWalk, calling xmlSchemaValidateElem(). 
Php :: js var to php 
Php :: php current datettime us time zone 
Php :: link js file in php 
Php :: remove slashes from json php 
Php :: get the value of href in anchar tag php 
Php :: phoenix input type password 
Php :: Algeria 
Php :: display rows brought back by query php 
Php :: php transform associative array to array 
Php :: js change h1 value 
Php :: qual é a melhor linguagem de 
Php :: laravel gigapay list employee 
Php :: add 30 minutes to time in php 
Php :: function that checks number only in php 
Php :: php check name 
Php :: php get precent price 
Php :: string to float laravel 
Php :: phpmyadmin max upload 
Php :: foreach skip first php 
Php :: php 6 digit random number 
Php :: how import the impliment countable php 
Php :: php check if string or number 
Php :: laravel run local to all land networks 
Php :: php inline if 
Php :: laravel session add array 
Php :: woocommerce check if cart is not empty 
Php :: wordpress get permalink in loop 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =