how to make code execute after Response.end

后端 未结 4 1158
感动是毒
感动是毒 2021-01-03 11:53

My code is like this

HttpContext.Current.Response.Clear();
     HttpContext.Current.Response.ContentType = \"application/pdf\";
     HttpContext.Current.Resp         


        
4条回答
  •  梦毁少年i
    2021-01-03 12:45

    Maybe fire some async method (fire and forget style) to delete the file or have a clean-up service on the server to delete all your files after certain time and rule.

    Like mentioned about Reponse.End is pretty harsh and final... more details here: Is Response.End() considered harmful?

    just my thoughts on that... =)

提交回复
热议问题