tp3.2使用thumb方法產生多張縮圖$upload = new ThinkUpload();// 實例化上傳類別<br>
$upload->maxSize = 3145728 ;// 設定附件上傳大小<br>
$upload->exts = array('jpg', 'gif', 'png', 》使用「
$upload->rootPath = "./Public/Admin/Uploads/"; // 設定附件上傳目錄// 上傳檔案<br>
$upload ->autoSub = true;<br>
$upload ->subName = array('date','Ymd');<br>
//設定上傳檔案規則<br>
$upload->saveRule = 'uniqid';<br>
$info = $upload->uploadOne($_FILES['photo']);<br>
if(!$info) {<br>
// 上傳錯誤提示錯誤訊息<br>
$this->error($upload->getError());<br>
}else {<br>
// 上傳成功 以取得上傳檔案資訊<br>
$img = $info['savepath'] . $info['savename'];<br>
$image = new ThinkImage();<br>
$BinImg = $upload->rootPath . "$img"; // 取得原圖絕對路徑<br>
$image->open($BinImg); // 開啟原圖<br>
// 添加水印<br>
// $image ->water($upload->rootPath."logo.png")-> save($upload ->rootPath.$img);<br>
// 產生一個<br>
// $image ->thumb(278,206,2); // 設定寬高且縮寫類型<br>
<br>
// 設定縮圖寬、高、前綴<br>
$thumb = array(<br>
);<br>
foreach ($thumb as $k => $v){<br>
$image->thumb($v['w'],$v['h'], 2); // 設定寬高與縮寫<br>
// 保存縮圖<br>
$smallimg[$k]= $info['savepath'] . "$v[n]" . $info['savename'];<br>
<br>
$image->save($upload->rootPath . $smallimg[$k]);<br> $_POST['小'.$k] = $smallimg[$k];<br>
}<br>
$_POST['goods_img'] = $img;<br>
<br>
}<br>
var_dump($_POST);退出;