Free Support Forum - aspose.com

Attachment file name cut to max 15 characters

I use aspose email to connect via ews to office365; the goal is to retrieve mails from a mailbox store the attachments on a fileshare and create a record in an sql server table for further processing.
Everything works fine so far with one exception: I cast the ews mails to a mapi client to get the attachments, than
For Each attn In msg.Attachments
filename = “F” + nr.Next(1, 999999).ToString.Trim + “_” + attn.FileName
attn.Save(savedir + filename)
insert_log(received, sent, sender, subject, attachment, filename, body, attn.FileName)
Next
if attn.filename has length > 15 chars then in the attn.save function simply cuts the name to 15 chars in the file system.
Is there any option to avoid this behavior and have the attachment names as originally found in the email?
Thanks,
Christian

@Ckramer1959,
Thank you for the query. Could you share a file of the email message to investigate this case, please? Also please specify the version of Aspose.Email you used.

Fw Fonds Kennzahlen JWWSF1-KATHREIN.7z (27.7 KB)
I use version: aspose email v21.4.0 and EWS v1.1.3
Regards,

@Ckramer1959,
Please try to use LongFileName property instead of FileName property.
API Reference: MapiAttachment Properties

thanks just found this property, sorry for silly question.

@Ckramer1959,
We are glad to help you with any queries and questions.