: This article mainly introduces the use of the ThinkPHP322 brushless new Upload plug-in uploadify. if you are interested in the PHP Tutorial, refer to it. 1. write a method in the controller for Uploading
Public function upload () {if (! Empty ($ _ FILES) {// image upload settings $ config = array ('maxsize' => 3145728, 'rootpath' => 'public ', 'savepath' => '/Uploads/', 'savename' => array ('uniqid', ''), 'exts' => array ('jpg ', 'gif', 'PNG ', 'jpeg'), 'autosub' => false, 'subname' => array ('date', 'ymmd '),); $ upload = new \ Think \ Upload ($ config); // instantiate the upload class $ images = $ upload-> upload (); // determine whether there is a graph if ($ images) {$ info = $ images ['filedata'] ['savename']; // return the file address and name to JS for echo $ info ;} else {$ this-> error ($ upload-> getError (); // Get failed information }}}II. Template
Index