is there a way to convert byte[] to its original file format?
Byte[] tempByte = new Byte[content.Length];
tempByte = Convert.FromBase64String(content);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have a Base64 encoded string, then yes Convert.FromBase64String will give you back a byte array identical to the one that was converted to a Base64 string.
However, your first line is unnecessary. You are allocating an array equal to the length of content which just gets overwritten by the return value from Convert.FromBase64String.