You are here

public function File::validateFile in One Click Upload 7.2

Check if file upload is complete

Return value

bool

1 method overrides File::validateFile()
MongoFile::validateFile in flowphp/src/Flow/Mongo/MongoFile.php

File

flowphp/src/Flow/File.php, line 119

Class

File

Namespace

Flow

Code

public function validateFile() {
  $totalChunks = $this->request
    ->getTotalChunks();
  $totalChunksSize = 0;
  for ($i = $totalChunks; $i >= 1; $i--) {
    $file = $this
      ->getChunkPath($i);
    if (!file_exists($file)) {
      return false;
    }
    $totalChunksSize += filesize($file);
  }
  return $this->request
    ->getTotalSize() == $totalChunksSize;
}