.net core 存储base64的图片或文件

        public void SaveImageFromBase64(string base64string)
        {
            byte[] b = Convert.FromBase64String(base64string);

            string path = Path.Combine(_env.WebRootPath, "test", "abc.jpg");//实际情况需要根据base64判断文件后缀名
            System.IO.File.WriteAllBytes(path, b);
        }

  

猜你喜欢

转载自www.cnblogs.com/fireicesion/p/10781466.html
今日推荐