Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

Commented Unassigned: System.FormatException on downloading attachments and embedded resources [2754]

$
0
0
When attempting to download attachments (and embedded resources), I receive an System.FormatException on the FileData property of the attachment:

```
System.FormatException
"The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters."
```

My code looks like this:

```
var messages = Client.Folders["INBOX"].Search("UNSEEN");
foreach(var message in messages)
{
...
foreach(var attachment in message.Attachments)
{
attachment.Download();
}
}
```

Before downloading, every attachment shows the file name and size. It simply fails when executing the download method. I'm using hMailServer, .NET 4.5 and IMapX version 2.0.0.18.
Comments: ** Comment from web user: nielsvos **

I've downloaded a couple of .eml files containing an attachment and decoded the base64 strings they consist of. All of them resulted in valid attachments. Can you please advice?


Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>