
Partial Class user_DownLoad
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim xCode As String = Page.Request.QueryString.Get("code")

            Dim dtFilename As String = xCode
            Dim dtPath As String = Server.MapPath("../files/") & dtFilename

            If Request.Browser.Browser = "IE" Then
                dtFilename = HttpUtility.UrlEncode(dtFilename)
            End If
            Response.ContentType = "application/zip"
            Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(dtFilename))
            Response.Flush()
            Response.TransmitFile(dtPath)
            Response.End()
        End If
    End Sub
End Class
