示例#1
0
        public async Task <HttpResponseMessage> ImportAsync([FromUri(Name = "portfolio")] string viewKey)
        {
            if (!Request.Content.IsMimeMultipartContent())
            {
                throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
            }

            // Get the files
            var provider = new MultipartFormDataStreamProvider(Path.GetTempPath());
            var files    = await Request.Content.ReadAsMultipartAsync(provider);

            await projectDataService.ImportProjectsAsync(viewKey, files);

            return(Request.CreateResponse(HttpStatusCode.OK));
        }