前台:

<h1>下载</h1>
<button onclick="location = 'download'">下载</button>

后台:

 public ActionResult download()
        {

            return File(new FileStream(Server.MapPath("/upload/20150917145429221.png"), FileMode.Open), "application/octet-stream", "test.png");
        }

 

相关文章:

  • 2021-10-07
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2021-05-14
  • 2021-08-20
猜你喜欢
  • 2022-03-05
  • 2022-12-23
  • 2021-05-28
  • 2021-09-12
  • 2022-02-11
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案