-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOCUMENTATION] attachment names have been changed to *.bin since 3.1.0 #533
Comments
the change is not a bug, this was done to fix #448, as well as relating to the bugs that occur with emails having multiple attachments with the same filename overwriting each other. |
documentation and release notes are a separate matter, however. |
Thank you for your reply. Since the attachment extension name was correct, my code only updated the attachment base name, so this fix actually broke it. It's very easy to fix, but I just think it's worth to mention any possible breaking changes in the release notes. |
I've just stumbled into this change myself. It seems like IncomingMailAttachment->fileExtension worked for me for referencing images the extension for jpg, gif, png, but something about a pdf is not returning pdf but instead .bin. I must be missing something obvious for the fix. |
can't recall 100% off the top of my head, but it may be related to fileinfo rather than looking at the original extension ? |
It seems like whatever I was doing originally to check the extension that I had wasn't doing anything any better than just taking it off the filename at this point. |
There is only the documentation in form of code: php-imap/src/PhpImap/Mailbox.php Lines 1404 to 1408 in 13bdfa9
...but this might will change in the future again: #645 So at the moment, you can for example change this behaviour to use the original file name like this: // Create PhpImap\Mailbox instance for all further actions
$mailbox = new PhpImap\Mailbox(
'{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder
'[email protected]', // Username for the before configured mailbox
'*********', // Password for the before configured username
__DIR__, // Directory, where attachments will be saved (optional)
'UTF-8', // Server encoding (optional)
true, // Trim leading/ending whitespaces of IMAP path (optional)
true // Attachment filename mode (optional; false = random filename; true = original filename)
); |
Hi,
3.1.0 changed the downloadAttachment function in Mailbox.php. Now the attachment file name is randomstring.bin, rather than the original file base name and extension name. This change is also not listed in the release log.
Thanks
The text was updated successfully, but these errors were encountered: