简体   繁体   中英

Codeigniter multiple image upload with different field names

I tried to upload multiple image form using codeigniter here the view code

        echo form_open_multipart('banner/upload');
        //name
        echo form_input('name'); 

        //image1:
        $data= array(
                'name'=>'userfile',
                'value'=>'$userfile'
                    );
        echo form_upload($data);

        //image2:
        $data= array(
                'name'=>'userfile',
                'value'=>'$userfile'
                    );
        echo form_upload($data);

        //image3:
        $data= array(
                'name'=>'userfile',
                'value'=>'$userfile'
                    );
        echo form_upload($data);

        echo form_submit('upload','upload');

How to get three image file form post and how to validate the image

aPlease refer to the below link: an additional library for multiple uploads in codeigniter.

https://github.com/stvnthomas/CodeIgniter-Multi-Upload

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM