Esempio n. 1
0
 /**
  * 获取附件路径 如:data/appbyme/upload/image/201412/02
  * 
  * @param mixed $type 附件的类型
  *
  * @return mixed Value.
  */
 private function _getPathFileName($type)
 {
     $path = '';
     $tempPath = $this->_getTempPath();
     $urlBasePath = '';
     switch ($type) {
         case 'audio':
             $urlBasePath = UploadUtils::getUploadAudioBaseUrlPath($tempPath);
             break;
         case 'image':
             $urlBasePath = UploadUtils::getUploadImageBaseUrlPath($tempPath);
             break;
         default:
             break;
     }
     $path = $urlBasePath . '/' . $tempPath;
     return $path;
 }
 private function _getPathFileName($type, $fileName)
 {
     $res = array('path' => '', 'file' => '');
     $tempPath = $this->_getTempPath();
     $urlBasePath = '';
     switch ($type) {
         case 'audio':
             $urlBasePath = UploadUtils::getUploadAudioBaseUrlPath($tempPath);
             break;
         case 'image':
             $urlBasePath = UploadUtils::getUploadImageBaseUrlPath($tempPath);
             break;
         default:
             break;
     }
     $res['path'] = $urlBasePath . '/' . $tempPath;
     $res['file'] = $this->_getRondomFileName($type, $fileName);
     return $res;
 }