public HttpResponseMessage ImagesUpload() { object result = string.Empty; string base64Code = DNTRequest.GetString("base64Code"); string sskdRequestParas = DNTRequest.GetString("sskdRequestParas"); if (!string.IsNullOrEmpty(base64Code)) { base64Code = base64Code.Replace(" ", "+"); base64Code = base64Code.Replace(" ", ""); base64Code = base64Code.Trim().Replace("%", "").Replace(",", "").Replace(" ", "+"); if (base64Code.Length % 4 > 0) { base64Code = base64Code.PadRight(base64Code.Length + 4 - base64Code.Length % 4, '='); } } byte[] photoData = new byte[0]; string msg = string.Empty; string fileName = string.Empty; string _contentType = "application/x-jpg"; photoData = DNTRequest.Base64StringToByte(base64Code, ref msg, ref fileName); if (!string.IsNullOrEmpty(msg)) { HttpResponseMessage res = new HttpResponseMessage { Content = new StringContent(msg, Encoding.GetEncoding("UTF-8"), "text/plain") }; return(res); } else { result = NewLoanInterface.ImagesUpload(base64Code, photoData, fileName, _contentType, sskdRequestParas); HttpResponseMessage res = new HttpResponseMessage { Content = new StringContent(result.ToString(), Encoding.GetEncoding("UTF-8"), "text/plain") }; return(res); } }