Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Thursday, September 24, 2015

asp.net create file from base 64

       public static bool CreateFileFromBase64(string fileName, string Base64Data)
        {
            try
            {
                FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate);
                byte[] data = Convert.FromBase64String(Base64Data);
                fs.Write(data, 0, data.Length);
                fs.Close();

                return true;
            }
            catch (Exception ex)
            {
                return false;
            }


        }