From 81057ffce46b63da8f9aaca971d3b574d3e3c401 Mon Sep 17 00:00:00 2001 From: xerifandtomas Date: Sat, 11 Mar 2023 17:11:01 +0100 Subject: [PATCH] save file with the same extension --- src/PhpImap/Mailbox.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpImap/Mailbox.php b/src/PhpImap/Mailbox.php index 02a3dad9..96349eae 100644 --- a/src/PhpImap/Mailbox.php +++ b/src/PhpImap/Mailbox.php @@ -1414,7 +1414,7 @@ public function downloadAttachment(DataPartInfo $dataInfo, array $params, object if (true == $this->getAttachmentFilenameMode()) { $fileSysName = $attachment->name; } else { - $fileSysName = \bin2hex(\random_bytes(16)).'.bin'; + $fileSysName = \bin2hex(\random_bytes(16)) . '.' . $attachment->fileExtension; } $filePath = $attachmentsDir.DIRECTORY_SEPARATOR.$fileSysName;