Example #1
0
 private function getpic($input)
 {
     $savePath = "./Data/upload/thumb/";
     $fileFormat = array('gif', 'jpg', 'jpeg', 'png', 'bmp');
     $maxSize = 0;
     $overwrite = 0;
     $thumb = 1;
     $thumbWidth = 200;
     $thumbHeight = 200;
     import('@.ORG.clsUpload');
     $picmodel = new clsUpload($savePath, $fileFormat, $maxSize, $overwrite);
     $picmodel->setThumb($thumb, $thumbWidth, $thumbHeight);
     if (!$picmodel->run($input, 1)) {
         echo $picmodel->errmsg() . "<br>\n";
     }
     $pic = $picmodel->getInfo();
     return "/Data/upload/thumb/" . $pic[0]["saveName"];
 }