public async Task<HttpResponseMessage> Upload() { if (!Request.Content.IsMimeMultipartContent("form-data")) { throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType); } var data = await Request.Content.ParseMultipartAsync(); if (data.Files.ContainsKey("file")) { var f = data.Files["file"].File; var cmd = new ImportZipPackage(inputConfigProvider, scriptProvider, storageProvider, appConfigProvider, f); await cmd.Execute(); } return new HttpResponseMessage(HttpStatusCode.OK); }
public async Task <HttpResponseMessage> Upload() { if (!Request.Content.IsMimeMultipartContent("form-data")) { throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType); } var data = await Request.Content.ParseMultipartAsync(); if (data.Files.ContainsKey("file")) { var f = data.Files["file"].File; var cmd = new ImportZipPackage(inputConfigProvider, scriptProvider, storageProvider, appConfigProvider, f); await cmd.Execute(); } return(new HttpResponseMessage(HttpStatusCode.OK)); }