我在一个asp页面中有这段代码
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.AppendHeader("content-disposition", "attachment; filename=PublicKeyCertificate.cer")
Response.ContentType = "application/x-x509-ca-cert"
Response.BinaryWrite(Session("cerbytes"))
Response.End()
End Sub
此代码下载 .cer 文件。不用下载,有什么办法可以打开吗?当您将内容类型设置为 application/pdf 时,大多数浏览器会在新选项卡中打开 pdf。我可以对 cer 文件做同样的事情吗?