Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all articles
Browse latest Browse all 3905

Answered: [Imap][Mail][.net] Attachment constructor: "Invalid Character error " with parameter 'name'

$
0
0

Hello,

the problem is that in many operation systems the '/' is recognized as directory separator, so the better practice is to omit such character. But if you really want to use it, there is a workaround:

using (Stream str = new MemoryStream(imap.MessageB))
{
    attachment.SetContent(str, "dummy");
    attachment.ContentType.Parameters["name"] = "invoice/17/12/9813";
    attachment.ContentDisposition.Parameters["filename"] = "invoice/17/12/9813";
}

Viewing all articles
Browse latest Browse all 3905

Latest Images

Trending Articles



Latest Images