Browse Source

修复分片上传未检测目录

Karson 5 years ago
parent
commit
9f04fcdb66
1 changed files with 3 additions and 0 deletions
  1. 3 0
      application/common/library/Upload.php

+ 3 - 0
application/common/library/Upload.php

@@ -248,6 +248,9 @@ class Upload
         $destDir = RUNTIME_PATH . 'chunks';
         $destDir = RUNTIME_PATH . 'chunks';
         $fileName = $chunkid . "-" . $chunkindex . '.part';
         $fileName = $chunkid . "-" . $chunkindex . '.part';
         $destFile = $destDir . DS . $fileName;
         $destFile = $destDir . DS . $fileName;
+        if (!is_dir($destDir)) {
+            @mkdir($destDir, 0755, true);
+        }
         if (!move_uploaded_file($this->file->getPathname(), $destFile)) {
         if (!move_uploaded_file($this->file->getPathname(), $destFile)) {
             throw new UploadException(__('Chunk file write error'));
             throw new UploadException(__('Chunk file write error'));
         }
         }