在本地下载PDF,并在单个按钮单击事件中将PDF上载到sql db
我在按钮点击事件中下载了PDF。我想在同一事件中上载相同的PDF。 下载文件时没有出现任何问题。但是在Response.end之后,不会执行任何代码将文件上载到SQL db 请在VB.net中推荐 短暂性脑缺血发作在本地下载PDF,并在单个按钮单击事件中将PDF上载到sql db,sql,vb.net,Sql,Vb.net,我在按钮点击事件中下载了PDF。我想在同一事件中上载相同的PDF。 下载文件时没有出现任何问题。但是在Response.end之后,不会执行任何代码将文件上载到SQL db 请在VB.net中推荐 短暂性脑缺血发作 CompleteRequest可以用来代替End,因为这可能有助于在End之后执行代码 HttpContext.Current.Response.ContentType = "application/pdf" HttpContext.Current.Response
CompleteRequest可以用来代替End,因为这可能有助于在End之后执行代码
HttpContext.Current.Response.ContentType = "application/pdf"
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" & fileName)
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache)
HttpContext.Current.Response.BinaryWrite(pdfContent)
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.Close()
'HttpContext.Current.Response.End()