Codeigniter 3 Image Upload

[Solved] Codeigniter 3 Image Upload | Php Frameworks Codeigniter - Code Explorer | yomemimo.com
Question : not able to upload .apk file in codeigniter 3.1.11

Answered by : shiny-stag-hjhvhcmelb51

'apk' => array('application/zip'),

Source : https://forum.codeigniter.com/thread-45406.html | Last Update : Sun, 27 Dec 20

Question : codeigniter 3 image upload

Answered by : sikadner

<?php<?phpdefined('BASEPATH') OR exit('No direct script access allowed');
class User extends CI_Controller { public function index(){ // load base_url $this->load->helper('url'); // Check form submit or not if($this->input->post('upload') != NULL ){ $data = array(); if(!empty($_FILES['file']['name'])){ // Set preference $config['upload_path'] = 'uploads/'; $config['allowed_types'] = 'jpg|jpeg|png|gif'; $config['max_size'] = '100'; // max_size in kb $config['file_name'] = $_FILES['file']['name']; // Load upload library $this->load->library('upload',$config); // File upload if($this->upload->do_upload('file')){ // Get data about the file $uploadData = $this->upload->data(); $filename = $uploadData['file_name']; $data['response'] = 'successfully uploaded '.$filename; }else{ $data['response'] = 'failed'; } }else{ $data['response'] = 'failed'; } // load view $this->load->view('user_view',$data); }else{ // load view $this->load->view('user_view'); } }
}

Source : https://makitweb.com/how-to-upload-file-in-codeigniter/ | Last Update : Wed, 06 Apr 22

Answers related to codeigniter 3 image upload

Code Explorer Popular Question For Php Frameworks Codeigniter