using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
namespace WebApi.Controllers
{
public class UploadController : ApiController
{
public void Up()
{
//多图上传
HttpContext context = HttpContext.Current;
HttpFileCollection files = context.Request.Files;
string path = context.Request.MapPath("~/");
string strPath = path + "App_Data/";
for (int i = 0; i < files.Count; i++)
{
strPath += files[i].FileName;
files[i].SaveAs(strPath);
}
context.Response.Clear();
context.Response.Write(strPath);
context.Response.End();
}
}
}