码迷,mamicode.com
首页 > 其他好文 > 详细

Base64编码保存到文件服务器

时间:2016-04-21 15:18:29      阅读:611      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!