Я пытаюсь, чтобы форма HTML отправляла файл в метод веб-службы Asp .Net.Кажется, все работает, но в веб-методе нет объекта или файла для объекта запроса.есть идеи?
HTML-форма
<form id="formPost" action="service/Post" enctype="multipart/form-data" method="post">
Post File <input id="uploadfile" type=file />
<input type=submit value="Post" />
</form>
Веб-сервис
[WebMethod]
public void Post()
{
// file collection of uploaded files in the http context
HttpFileCollection Files = this.Context.Request.Files;
// always 0 and no form either
if (Files.Count > 0)
{}
}