Invalid length for a Base-64 string. ??? Any ideas?

G

Guest

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.LoadPageStateFromPersistenceMedium()

= = = == = = = = = == = = == == == == ===== = = = = = = = = = == == = = ==

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!!!
 
G

Guest

Hi Bruce,

Thanks for the reply. But how can I get rid of this problem?

Thanks!!!

Bruce Barker said:
base64 string have to be even in length to be valid.

-- bruce (sqlwork.com)


Diffident said:
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.LoadPageStateFromPersistenceMedium()

= = = == = = = = = == = = == == == == ===== = = = = = = = = = == == = =
==

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!!!
 
B

Bruce Barker

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 said:
Hi Bruce,

Thanks for the reply. But how can I get rid of this problem?

Thanks!!!

Bruce Barker said:
base64 string have to be even in length to be valid.

-- bruce (sqlwork.com)


Diffident said:
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.LoadPageStateFromPersistenceMedium()

= = = == = = = = = == = = == == == == ===== = = = = = = = = = == ==
= =
==

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!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top