byte[] bytes = Convert.FromBase64String(Picture);
System.IO.File.WriteAllBytes(Server.MapPath("~/Content/" + Name), bytes);
此代码在本地服务器上运行良好,但当我尝试在实时服务器上运行时,这会产生错误,文件不会上传到内容文件夹中。
答案 0 :(得分:1)
请检查您是否具有要保存图像的文件夹的写入权限。我觉得这可能只是问题,否则Server.MapPath(.....
应该可以正常工作。