Browse Source

1.文件名获取bug

NoNZero 8 years ago
parent
commit
8aab38f848
1 changed files with 2 additions and 2 deletions
  1. 2 2
      protected/controller/ClientController.php

+ 2 - 2
protected/controller/ClientController.php

@@ -1166,8 +1166,8 @@ class ClientController extends DooController
             if (isset($fileArray['filepath'])) {
                 $pidArray = $this->actmeasure->getRowByPmid($this->params['tenderid']);
                 $memoStr = iconv('GBK', 'UTF-8', $_POST['Memo']);
-                $fnArray = explode('.', $fileArray['filename']);
-                $filenameStr = iconv('GBK', 'UTF-8', $fnArray[0]);
+                $fname = basename($fileArray['filename'], $fileArray['fileext']);
+                $filenameStr = iconv('GBK', 'UTF-8', $fname);
                 $postArray = array('ownerid' => $this->params['uid'], 'pid' => $pidArray['pid'], 'pmid' => $this->params['tenderid'], 'filename' => $filenameStr, 'filesize' => $fileArray['filesize'], 'fileext' => $fileArray['fileext'], 'filepath' => $fileArray['filepath']);
                 $iaid = $this->itemfile->insertItemFileRecord($postArray);
                 if ($iaid > 1) {