Response.TransmitFile无效

时间:2014-04-02 12:45:19

标签: vb.net response.transmitfile

Response.TransmitFile但是文件没有下载没有javascript错误没有任何异常代码顺利执行。

Dim FilePath As String = Functions.DecryptString(HttpUtility.UrlDecode(Request.Form("filepath")).Replace(" ", "+"), Settings.UrlEncryptionKey, Settings.UrlEncryptionVecotor).ToString()
    Dim FileName As String = Request.Form("filename")
    Dim CompletePath = Settings.WebSiteResourcePhysicalPath & FilePath & FileName

    If IO.File.Exists(CompletePath) Then
        Response.Clear()
        Response.AppendHeader("content-disposition", "attachment; filename=" + FileName)
        Response.ContentType = "Application/octet-binary"
        Response.TransmitFile(CompletePath)
        Response.End()
        Response.Flush()
    End If

复制并粘贴“CompletePath”,文件也在那里。请帮帮我

0 个答案:

没有答案