Bootstrap+php to achieve multi-image upload

Source: Internet
Author: User

Plug-in and source code can be downloaded here http://www.jq22.com/jquery-info5231
The following is supplemented by the downloaded demo:
Use bootstrap interface beautiful, can preview, can drag upload, can cooperate with Ajax asynchronous or synchronous upload, the following is:

Front-end Code: fileinput.html

<! DOCTYPE html><!--release v4.1.8, copyright 2014-2015 Kartik visweswaran-->

Background code:

    /    * * BOOTST multi-image upload */public    function fileinput ()    {                return $this->fetch ();    }    Public Function uploadimg ()    {        //Var_dump ($_files);        Get form upload file         $file = Request ()->file (' images ');        Move to the Framework app root directory under the/public/uploads/img directory        $info = $file->move (root_path. ' Public '. Ds. ' uploads/img ');                if ($info) {            //successfully upload after uploading information            $data [' response '] = $info->getsavename ();            Return JSON ($DATA);                        Image upload successful, the following can be used for database operation            //...                    } else{            //upload failed to get error message            echo $file->geterror ();}            }

Bootstrap+php to achieve multi-image upload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.