html 上传文件

1.html代码

  <form id="form1" action="TestYield" method="post" enctype="multipart/form-data">
<div> <input type="text" id="title" name="title"/>
<input type="file" id="file" name="file"/> <input type="submit" value="提交" />
</div>
</form>

2.后台接收代码

   HttpFileCollection hfc = Context.Request.Files;

            if (Request["title"] != null)
{
Response.Write(Request["title"]);
}
if (hfc.Count>)
{
HttpPostedFile hf = Context.Request.Files["file"]; Response.Write(hf.FileName);
}
else
{
Response.Write("is null");
}
return;
上一篇:大数据 --> 分布式服务框架Zookeeper


下一篇:maven打包可执行jar文件运行报错