예제 #1
0
        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);
        }
예제 #2
0
        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));
        }