/// base64上传图片
/// </summary>
/// <returns>成功上传返回上传后的文件名</returns>
[HttpPost]
public async Task<IHttpActionResult> UpLoadImageBase64()
{
HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"];
string text = context.Request.Form["file"];
Stream stream = ]));
using (HttpClient client = new HttpClient())
{
var request = new HttpRequestMessage(HttpMethod.Post, ConfigurationManager.AppSettings["Imgaes"].ToString() + "/Upload");
var content = new MultipartFormDataContent();
//client.DefaultRequestHeaders.Add("fileext", HttpContext.Request.Headers["fileext"]);
content.Add(new StreamContent(stream), "file", "file.jpg");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var filenamestr = await response.Content.ReadAsStringAsync();//返回结果
}
return Ok();
}