/** * Get unique but consistent name * @param string $name * @param string $type * @param integer $index * @param array $content_range * @return string */ protected function getUniqueFilename($name, $type, $index, $content_range) { while ($this->filesystem->isDir($this->pathresolver->getUploadPath($name))) { $name = $this->pathresolver->upcountName($name); } $uploaded_bytes = Util::fixIntegerOverflow(intval($content_range[1])); while ($this->filesystem->isFile($this->pathresolver->getUploadPath($name))) { if ($uploaded_bytes == $this->filesystem->getFilesize($this->pathresolver->getUploadPath($name))) { break; } $name = $this->pathresolver->upcountName($name); } return $name; }
/** * Get size of file * @param string $path * @param boolean $clear_cache * @return float */ protected function getFilesize($path, $clear_cache = false) { if ($clear_cache) { $this->filesystem->clearStatCache($path); } return $this->fixIntegerOverflow($this->filesystem->getFilesize($path)); }