We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55d8bde commit 5d3fee1Copy full SHA for 5d3fee1
1 file changed
src/Flow/Mongo/MongoFile.php
@@ -112,15 +112,11 @@ public function saveChunk($additionalUpdateOptions = [])
112
*/
113
public function validateFile()
114
{
115
- $totalChunks = $this->request->getTotalChunks();
116
-
117
- for ($i = 1; $i <= $totalChunks; $i++) {
118
- if (!$this->chunkExists($i)) {
119
- return false;
120
- }
121
122
123
- return true;
+ $totalChunks = intval($this->request->getTotalChunks());
+ $storedChunks = $this->config->getGridFs()->chunks
+ ->find(['files_id' => $this->getGridFsFile()['_id']])
+ ->count();
+ return $totalChunks === $storedChunks;
124
}
125
126
0 commit comments