html页面+ashx添加邮箱附件(上传文件)

用html页面上传文件不同于直接用aspx代码,html页面的form标签式下面的格式

:<form id="form_file" action="Handler/SmtpMailHandler.ashx"  enctype="multipart/form-data"  method="post">

method=post, enctype=multipart/form-data这两个属性是一个都不能少的,否则ashx页面获取不到文件流。

然后把form submit就可以在ashx页获取到文件流了。

原文地址:https://www.cnblogs.com/sheseido/p/2261865.html