bootstrap+php implementation of multi-image upload steps

Source: Internet
Author: User
This time to bring you bootstrap+php to achieve a multi-map upload steps in detail, bootstrap+php to realize the multi-image upload notes, the following is the actual case, together to see.

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 ();}  }

Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!

Recommended reading:

Php+session prevent form Repeat submission steps

PHP Cache Tool XCache Installation and use case resolution

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.