简体   繁体   English

使用jquery和ASP.NET异步上传文件

[英]Async file upload with jquery and ASP.NET

I have read one article for Async file upload in ASP.NET here . 我在这里阅读了一篇有关在ASP.NET中上传异步文件的文章。

It is working till the .ashx file call but showing "context.Request.Files.Count" 0. 它一直工作到.ashx文件调用,但显示“ context.Request.Files.Count” 0。

在此处输入图片说明

Can anyone help? 有人可以帮忙吗?

You need to add enctype="multipart/form-data" to the HTML form, like this: 您需要将enctype="multipart/form-data"到HTML表单中,如下所示:

<form enctype="multipart/form-data">

OR 要么

YourForm.Attributes.Add("enctype", "multipart/form-data");

You also need to verify that your HTML <input> of type file has a name attribute, like this: 您还需要验证文件类型的HTML <input>是否具有name属性,如下所示:

<input type="file" name="MyFileInput" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM