Posts

Showing posts with the label library

How To Upload Multiple Files Using Codeigniter ?

This is simply an extension to the existing Codeigniter's Upload flat to accept wages of multiple uploads inwards i shape field. Installation Copy MY_Upload.php to your application/libraries directory. If y'all are using a prefix other than MY_ for your classes and/or choice file paths, conform accordingly. Usage Load the Upload flat equally usual, inwards your controller telephone band the component do_multi_upload(). If y'all are uploading a unmarried file, it'll default to the regular do_upload() method. In the form, laid plain names to array (e.g. name="userfile[]") MY_Upload.php <?php if ( ! defined('BASEPATH')) exit('No straight script access allowed'); /** * Exenstion File Uploading Class */ flat MY_Upload extends CI_Upload { world component do_multi_upload( $field = 'userfile', $return_info = TRUE, $filenames = NULL ){ // Is $_FILES[$field] set? If not, no argue to continue. if ( ! isset($_FILES[$fiel...