首页 > 其他 > 详细

Base64编码保存到文件服务器

时间:2016-04-21 15:18:08      阅读:342      评论:0      收藏:0      [点我收藏+]
  byte[] buffer = Convert.FromBase64String(param.Base64Code);
                System.Net.WebClient webClient = new System.Net.WebClient();
                param.MsysGuid = Utils.NewGUID;
                param.FileName = String.Format("{0}.jpg", param.OrderMumber);
                string webHostUrl = string.Format("http://{0}/Upload.aspx?&fid={1}&fname={2}&fsize={3}&guid={4}",
                                                        Utils.FileServerIp, param.MsysGuid, Uri.EscapeDataString(param.FileName), buffer.Length, param.MsysGuid);
                byte[] bytes = webClient.UploadData(webHostUrl, buffer);
                string result = webClient.Encoding.GetString(bytes);
                webClient.Dispose();
                if (result.StartsWith("##"))
                {
                    throw new Exception(result);
                }

 

Base64编码保存到文件服务器

原文:http://www.cnblogs.com/sunxuchu/p/5416898.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!