Invalid length for a Base-64 char array or string

Posted by: phil on 14 December 2018, 2:44 am EST

  • Posted 14 December 2018, 2:44 am EST

    Hello,

    Im using the richtextbox for silverlight component. On the odd email I'm getting an error when I set the html property of the component to the contents of the email:

    System.FormatException: Invalid length for a Base-64 char array or string

    Any ideas as to the cause? I've attached a longer version of the error so you can see where it's coming from.

    Thanks,

    Phil.

  • Replied 16 December 2018, 11:50 pm EST

    Hello Phil,

    Thank you for attaching the stack trace of the exception.
    The probable cause of the exception might be that your mail content is having some "spaces" and "+" which are creating issues.
    So,could you please confirm the following:
    1. Whether/not you are using the latest version of ComponentOne at your end.
    2. Check whether the exception comes with every email content/not. If it is related to a specific email only, please share the odd email content for us to check. If you have any issues sharing the contents here, please share the same at https://supportone.componentone.com

    Thanks,
    Ruchir
  • Marked as Answer

    Replied 17 December 2018, 4:07 am EST

    Hello,

    thanks for the reply.

    I've narrowed down the issue. In trying to create a test email for you, I've discovered that it's to do with images, specifically when there's a base64 encoded image that's invalid.

    In fact no base64 encoded images display.
    - Valid ones do not display, which is no problem for us.
    - Invalid ones though cause an error which is a problem.

    I'll write some code to strip out all base64 encoded images and that'll solve the problem.

    Finally to answer your question on versions we are a bit out of date, so perhaps you've fixed this is a more recent update.

    thanks,

    Phil.
  • Replied 17 December 2018, 10:36 pm EST

    We are glad to know you have found the issue and have successfully resolved it.
    Let me know, if you need any help.

    Thanks,
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels