views:

47

answers:

1

Hi , I have silverlight app that post some data to another web application ,the data to post is converted to base 64 using code

byte[] byteArray = Encoding.UTF8.GetBytes(sDataToPost);
sDataToPost = Convert.ToBase64String(byteArray);

Another webapplication get the data using the code

strText = System.Text.Encoding.ASCII.GetString(System.Convert.FromBase64String(postedData));

But it gives the exception invalid length for a base-64 char array

Thanks in Advance DNM

A: 

Depending on how you post the data its quite possible that the Base64 string is being munged a little more. For example URL encoders may do odd things with the + and = symbols in the Base64 string.

AnthonyWJones