with base64, every three bytes (24 bits) of data is converted to four bytes
of printable data (6 bit). when you convert base64 back, you read 4 bytes at
a time and convert back to 3 bytes. you get this error when you don't have a
mulitple of 4. most likely the data is bad, you can append 1 to 3 '='s
to get the correct length (these convert to nulls). you should figure out
why your base64 string are actually invalid.
-- bruce (sqlwork.com)
"Diffident" <> wrote in message
news:AFB1609D-DB86-4D55-AAFC-...
> Hi Bruce,
>
> Thanks for the reply. But how can I get rid of this problem?
>
> Thanks!!!
>
> "Bruce Barker" wrote:
>
>> base64 string have to be even in length to be valid.
>>
>> -- bruce (sqlwork.com)
>>
>>
>> "Diffident" <> wrote in message
>> news:6086DB4E-08C9-4AAF-B474-...
>> > ErrorMessage:
>> > -------------
>> > Invalid length for a Base-64 string.
>> >
>> > ErrorSource:
>> > -------------
>> > mscorlib
>> >
>> > ErrorTargetSite:
>> > ----------------
>> > Byte[] FromBase64String(System.String)
>> >
>> > ErrorTrace:
>> > ----------------
>> > at System.Convert.FromBase64String(String s)
>> > at System.Web.UI.LosFormatter.Deserialize(String input)
>> > at System.Web.UI.Page.LoadPageStateFromPersistenceMed ium()
>> >
>> > = = = == = = = = = == = = == == == == ===== = = = = = = = = = == ==
>> > = =
>> > ==
>> >
>> > Hello All,
>> >
>> > Can anyone explain me about this error. I do not think that it is with
>> > my
>> > application code. I cannot debug this problem.....
>> >
>> > Thanks!!!
>> >
>> >
>> >
>>
>>
>>
|