Base64 string

I convert an image and store it into the database then i retrieve it to convert back into byte it tells me invalid length. Why is this happening? Anyone has any solution?

Could you post the relevant code doing your image conversions to/from your database format? From your title I’m assuming you’re converting an image byte[ ] to and from a base64 string. With a Texture2D you should be able to use GetRawTextureData or EncodeToJPG/PNG methods and LoadRawTextureData or LoadImage methods to convert to/from a byte[ ]. Then you should be able to use System.Convert.To/FromBase64String to convert between a byte[ ] and a base64 string.

If none of that works, the only thing thta occurs to me is that maybe your base64 string is getting padded or something either somewhere in the conversions or as it’s inserted and retrieved from you DB. Can you provide more details?