diff --git a/lib/Providers/Personal/PersonalService.php b/lib/Providers/Personal/PersonalService.php index f1146be..b1e9214 100644 --- a/lib/Providers/Personal/PersonalService.php +++ b/lib/Providers/Personal/PersonalService.php @@ -712,8 +712,8 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI throw new InvalidParameterException("Entity not found: $identifier"); } - // detect MIME type and format from content header - $signature = Signature::detect(substr($data, 0, Signature::HEADER_SIZE)); + // detect MIME type and format from content (full content lets us tell OOXML/ODF apart from a plain zip) + $signature = Signature::detect(substr($data, 0, Signature::SAMPLE_SIZE), $data); // Write blob data $size = $this->blobStore->blobWrite((string)$identifier, $data); @@ -779,7 +779,7 @@ class PersonalService implements ServiceBaseInterface, ServiceCollectionMutableI // Detect MIME type and format from first chunk (offset === 0) $signature = null; if ($offset === 0) { - $signature = Signature::detect(substr($data, 0, Signature::HEADER_SIZE)); + $signature = Signature::detect(substr($data, 0, Signature::SAMPLE_SIZE), $data); } $bytes = $this->blobStore->blobWriteChunk((string)$identifier, $offset, $data);