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