Quantcast
Channel: Aspose.Email Product Family
Viewing all articles
Browse latest Browse all 1367

Exception processing email attachments

$
0
0
Hi,

We are getting exceptions when processing email attachments that filenames contain double single quotes at the end (test''.txt).  The exception occurs when the Attachment.Name setter is invoked.  The StackTrace appears to indicate the offending filename is resulting in an attempted to find the strings encoding.  Double single quotes in the middle of the filename do not cause the exception.  Apose.Email for .NET 4.0 version 17.1.0.0.

scrubbedName = FileAndPathNameIllegalCharUtility.CreateSafeFileName(att.Name, out scrubbedName, scrubOptions);                    if (scrubbedName.IsNotNullOrEmpty())                    {                        att.Name = scrubbedName;  //Exception here                        //Good attachment name add to a list for processing                        attachments.Add(att);                    }
Characters removed by CreateSafeFileName (URI_ILLEGAL_CHARS = { '@''"''$''&'':''<''>''{''}''['']',
 '#''%''/'';''=''?''\\''^''|''~''\'''\"' };

StackTrace-

   at System.Globalization.EncodingTable.internalGetCodePageFromName(String name)

   at System.Globalization.EncodingTable.GetCodePageFromName(String name)

   at System.Text.Encoding.GetEncoding(String name)

   at #=q_60aBNxG2$SuXCZfZj8RxMuQ4QvMCxRRNzSjx5tNaig=.#=qMYQy_hVHueJdS6Pxw7GcW6PqRwLc9ouD2xur1bMlMIg=(String #=qRIDVWGAM$0BkCBJQsYmZAw==)

   at Aspose.Email.Mime.ContentDisposition.get_FileName()

   at Aspose.Email.Mail.Attachment.#=qjNb7XloW0J8_3iKnFFn9wvb23aHjAydf$MMzPynAANM=(Boolean& #=qJg7wl47f7hGQvPeIF4FbAsdWdbO_jXQy7EOPmbLH5wM=)

  at Aspose.Email.Mail.Attachment.#=qKmpcowkezBlTXeK44UnmdLVLTH_u7dGPaJWEJTJIVBQ=(String #=q7G9LZy5KsRJ$RaSgKMwaRg==)

   at Aspose.Email.Mail.Attachment.set_Name(String value)

   at Hyland.Core.SubscriptionServer.Module.CheckForAttachment(MailMessage message, List`1 attachments, IllegalCharacterScrubOptions scrubOptions) in M:\TFS\DEV\Core\OnBase.NET\Libraries\Hyland.Core\SubscriptionServer\Module.cs:line 1313

Thank you,
Cameron

Viewing all articles
Browse latest Browse all 1367

Trending Articles