$realFilePath, 'fileSize' => filesize($realFilePath), 'fileName' => $fileName != '' ? $fileName : basename($realFilePath), 'mimeType' => $mimeType != '' ? $mimeType : mime_content_type($realFilePath) ) ); } /** * @param \eZ\Publish\Core\FieldType\BinaryFile\Value $fieldValue * @param array $context * @return array * * @todo check if this works in ezplatform */ public function fieldValueToHash($fieldValue, array $context = array()) { if ($fieldValue->uri == null) { return null; } return array( 'path' => realpath($this->ioRootDir) . '/' . ($this->ioDecorator ? $this->ioDecorator->undecorate($fieldValue->uri) : $fieldValue->uri), 'filename'=> $fieldValue->fileName, 'mimeType' => $fieldValue->mimeType ); } }