Thinkphp + smarty + uploadify implements no refreshing upload and thinkphpsmarty
The example in this article describes Thinkphp + smarty + uploadify to implement the method of refreshing upload. Share it with you for your reference. The details are as follows:
Template File Code:
<! DOCTYPE html>
Controller code:
Public function uploads () {$ arr = array ("errorcode" => "1", "errormsg" => "uploaded successfully! "); $ Model = M ('applicant'); if (! Empty ($ _ FILES) {// Image Upload settings $ config = array ('maxsize' => 1000000, '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 $ info = $ upload-> upload (); if ($ info) {$ arr ['errorcode'] = "0";} else {$ arr ["errorcode"] = "1 "; $ arr ["errormsg"] = $ upload-> getError ();}/* return JSON data */$ this-> ajaxReturn ($ arr );}}
I hope this article will help you with php programming.